Skip to content

Flow Name: Committee Member after insert/update

Last Updated: 2025-03-31 Source Code: Committee_Member_after_insert_update.flow-meta.xml

API Name: Committee_Member_after_insert_update Status: Active Type: Custom Trigger: After save (create and update) of Committee_member__c records

Business Purpose

This flow maintains accurate member status tracking by updating Person Account flags (Is_BoardMember__c and Is_Staterep__c) when Committee Member records are created or updated. It ensures member classification reflects current committee participation by analyzing both the current record and all existing memberships.

Process Flow

  1. All Committee Memberships: Queries existing Committee_member__c records for the same Member__c
  2. Current Record Analysis: Uses formulas to check if the current record represents:
  3. Board Member: Committee.Type__c = "Board member"
  4. Staff Liaison: Committee.Type__c = "Staff Liaison"
  5. Existing Memberships Loop: Examines all existing committee memberships to identify:
  6. Board Member Roles: Role__c = "Board Member" OR Committee.Type__c = "Staff Liaison"
  7. Staff Liaison Roles: Committee.Type__c = "Staff Liaison"
  8. Status Determination: Combines current record analysis with existing memberships
  9. Account Update Logic:
  10. Is_BoardMember__c: Set to true if current OR existing memberships include board member role
  11. Is_Staterep__c: Set to true if current OR existing memberships include staff liaison role
  12. Account Update: Updates the related Person Account when status changes are needed
📊 Click to view Process Flow Diagram
flowchart TD
    Start([Start: Committee_member Create/Update<br/>After Save Trigger]) --> GetAll[Get All Committee_member__c<br/>Records for Member]

    GetAll --> CheckCurrent[Check Current Record:<br/>Is Board Member OR<br/>Staff Liaison?]

    CheckCurrent --> Loop[Loop Through<br/>Existing Memberships]

    Loop --> CheckExisting{Role = "Board Member"<br/>OR<br/>Committee Type = "Staff Liaison"?}

    CheckExisting -->|Yes| SetFlags[Set Status Flags]
    CheckExisting -->|No| Continue[Continue Loop]

    SetFlags --> Continue

    Continue --> MoreRecords{More<br/>Memberships?}
    MoreRecords -->|Yes| Loop
    MoreRecords -->|No| Combine[Combine Current +<br/>Existing Analysis]

    Combine --> UpdateAcct[Update Account:<br/>• Is_BoardMember__c<br/>• Is_Staterep__c]

    UpdateAcct --> End([End])

    style Start fill:#e1f5ff
    style GetAll fill:#f0e1ff
    style CheckCurrent fill:#fff4e1
    style Loop fill:#e1ffe1
    style CheckExisting fill:#fff4e1
    style SetFlags fill:#ffe1e1
    style Continue fill:#e1ffe1
    style MoreRecords fill:#fff4e1
    style Combine fill:#e1ffe1
    style UpdateAcct fill:#ffe1e1
    style End fill:#e1f5ff

Key Business Rules

  • Analyzes both the current record being saved AND all existing committee memberships
  • Uses complex logic combining Role__c field and Committee.Type__c field
  • Updates Person Account only when status flags need to change from current values
  • Board Member detection: Current record has Type__c="Board member" OR existing records have Role__c="Board Member"
  • Staff Liaison detection: Current record has Type__c="Staff Liaison" OR existing records have Committee.Type__c="Staff Liaison"
  • Uses WasVisited logic to track which updates are necessary

Dependencies

  • Committee_member__c custom object with Member__c lookup and Role__c field
  • Committee__c custom object with Type__c picklist field
  • Account standard object with Is_BoardMember__c and Is_Staterep__c custom fields
  • User management processes that depend on these account flags
  • PR-31361 (referenced in description)

⚠️ Pre-Go-Live Concerns

CRITICAL - Fix Before Go-Live

  • Logic Inconsistency: Board member detection uses different field combinations (Role__c vs Committee.Type__c) - verify this is intentional
  • Field Mapping: Unclear why both Role__c and Committee.Type__c are used for similar classifications

HIGH - Address Soon After Go-Live

  • Complex Logic: Multiple field combinations and decision points increase risk of incorrect status assignment
  • Performance: Queries all committee memberships on every save - monitor for performance impact

MEDIUM - Future Enhancement

  • Logic Simplification: Consider standardizing on single field for member type classification
  • Audit Trail: No tracking of status changes for accountability purposes

LOW - Monitor

  • Data Consistency: Monitor for Role__c and Committee.Type__c field alignment issues
  • Field Usage: Verify downstream systems handle Is_BoardMember__c and Is_Staterep__c correctly

Maintenance Notes

Complexity: Medium-High - Complex multi-field logic with formulas and conditional updates. Review quarterly to ensure field usage patterns align with business requirements. Test thoroughly when modifying committee structures or adding new role types. Consider simplifying logic if maintenance becomes difficult.