Flow Name: Committee Member after delete¶
Last Updated: 2024-11-14 Source Code: Committee_Member_after_delete.flow-meta.xml
API Name: Committee_Member_after_delete Status: Active Type: Custom Trigger: Before delete 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 deleted. It ensures that member classification remains current by checking remaining committee memberships after a deletion occurs.
Process Flow¶
- Related Committee Check: Queries all other Committee_member__c records for the same Member__c (excluding the one being deleted)
- Membership Analysis: Loops through remaining committee memberships to determine:
- Board Member Status: Checks if any remaining committees have Type__c = "Board Member"
- Staff Liaison Status: Checks if any remaining committees have Type__c = "Staff Liaison"
- Account Update Logic:
- Is_BoardMember__c: Set to true if remaining memberships include board member role, false otherwise
- Is_Staterep__c: Set to true if remaining memberships include staff liaison role, false otherwise
- Account Update: Updates the related Person Account with corrected status flags
📊 Click to view Process Flow Diagram
flowchart TD
Start([Start: Committee_member Delete<br/>Before Delete Trigger]) --> GetRemaining[Get Other Committee_member__c<br/>Records for Same Member]
GetRemaining --> Loop[Loop Through<br/>Remaining Memberships]
Loop --> CheckBoard{Committee Type =<br/>"Board Member"?}
CheckBoard -->|Yes| SetBoard[Set BoardMember Flag]
CheckBoard -->|No| CheckLiaison
CheckLiaison{Committee Type =<br/>"Staff Liaison"?}
CheckLiaison -->|Yes| SetLiaison[Set StaffLiaison Flag]
CheckLiaison -->|No| Continue[Continue Loop]
SetBoard --> Continue
SetLiaison --> Continue
Continue --> MoreRecords{More<br/>Memberships?}
MoreRecords -->|Yes| Loop
MoreRecords -->|No| UpdateAcct[Update Account:<br/>• Is_BoardMember__c = Flag Status<br/>• Is_Staterep__c = Flag Status]
UpdateAcct --> End([End])
style Start fill:#e1f5ff
style GetRemaining fill:#f0e1ff
style Loop fill:#e1ffe1
style CheckBoard fill:#fff4e1
style CheckLiaison fill:#fff4e1
style SetBoard fill:#ffe1e1
style SetLiaison fill:#ffe1e1
style Continue fill:#e1ffe1
style MoreRecords fill:#fff4e1
style UpdateAcct fill:#ffe1e1
style End fill:#e1f5ff
Key Business Rules¶
- Only processes deletions that would change the member's overall status
- Analyzes remaining committee memberships (excluding the record being deleted)
- Updates Person Account only when status flags need to change
- Board Member status based on Committee.Type__c = "Board Member" (note: inconsistent casing in description vs code)
- Staff Liaison status based on Committee.Type__c = "Staff Liaison"
- Uses WasVisited logic to track which updates are needed
Dependencies¶
- Committee_member__c custom object with Member__c lookup 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¶
- Naming Inconsistency: Description mentions "Board member" but formula uses "Board member" (different casing) - verify picklist values
- Data Integrity: No validation that Member__c field points to a Person Account
HIGH - Address Soon After Go-Live¶
- Performance: Queries all committee memberships on every deletion - consider optimization for high-volume scenarios
- Concurrency: Multiple simultaneous committee deletions for same member may cause issues
MEDIUM - Future Enhancement¶
- Audit Trail: No tracking of status changes for compliance purposes
- Error Handling: No notification if account update fails
LOW - Monitor¶
- Field Usage: Verify downstream systems properly use Is_BoardMember__c and Is_Staterep__c flags
- Logic Consistency: Monitor for any committee type additions that might affect status logic
Maintenance Notes¶
Complexity: Medium - Complex logic with loops and conditional account updates. Review quarterly to ensure committee types and member status logic remain aligned with business requirements. Test thoroughly when adding new committee types. Monitor performance if committee membership volumes grow significantly.