Flow Name: Calculate Continuous Member Since At Least field¶
Last Updated: 2025-09-30 Source Code: Calculate_Continuous_Member_Since_At_Least_field.flow-meta.xml
API Name: Calculate_Continuous_Member_Since_At_Least_field Status: Active Type: Custom Trigger: Record Create and Update (Membership__c) - After Save
Business Purpose¶
This flow tracks continuous membership by calculating how long a person has been a member without any inactive periods. When a membership becomes active, it sets the start date for continuous membership calculation. When a membership expires, it clears the continuous membership date to restart the calculation from the next active membership.
Process Flow¶
- Trigger Activation: Fires when Membership__c records are created or updated
- Status Evaluation: Checks the membership status:
- Active Status: If Status__c = "Active" AND Account's Continuous_Member_Since_At_Least_Date__c is null
- Sets Account.Continuous_Member_Since_At_Least_Date__c = Membership.Start_Date__c
- Expired Status: If Status__c = "Expired" (with record change requirement)
- Clears Account.Continuous_Member_Since_At_Least_Date__c (sets to null)
- Account Update: Updates the related Person Account with the calculated date
📊 Click to view Process Flow Diagram
flowchart TD
Start([Start: Membership Create/Update<br/>After Save Trigger]) --> StatusCheck{Membership Status?}
StatusCheck -->|Active &<br/>Continuous Date Null| SetStart[Set Account<br/>Continuous_Member_Since_At_Least_Date__c<br/>= Membership Start_Date__c]
StatusCheck -->|Expired| ClearDate[Clear Account<br/>Continuous_Member_Since_At_Least_Date__c<br/>set to NULL]
StatusCheck -->|Other| End([End])
SetStart --> End
ClearDate --> End
style Start fill:#e1f5ff
style StatusCheck fill:#fff4e1
style SetStart fill:#ffe1e1
style ClearDate fill:#ffe1e1
style End fill:#e1f5ff
Key Business Rules¶
- Continuous membership tracking only starts when no prior continuous date exists
- Active memberships establish the continuous membership start date using the membership's start date
- Expired memberships reset the continuous membership calculation
- Field is cleared when membership expires to allow recalculation from next active membership
- Uses "doesRequireRecordChangedToMeetCriteria" for expired status to ensure it only fires on actual status changes
Dependencies¶
- Objects:
- Membership__c (Custom object)
- Account (Standard object with person account functionality)
- Custom Fields:
- Membership__c.Status__c
- Membership__c.Start_Date__c
- Membership__c.Account_Name__c (relationship field)
- Account.Continuous_Member_Since_At_Least_Date__c
- Relationships: Membership__c.Account_Name__c to Account
Changes¶
- PR-34169: Updated field to date type (noted in flow description)
⚠️ Pre-Go-Live Concerns¶
CRITICAL - Fix Before Go-Live¶
- Data Integrity Risk: No validation that Start_Date__c is not null before setting continuous date
- Relationship Validation: No error handling if Account_Name__c reference is invalid
HIGH - Address Soon After Go-Live¶
- Missing Error Handling: No fault paths for failed account updates
- Business Logic Gap: No handling for membership status changes other than Active/Expired (e.g., Suspended, Cancelled)
- Date Validation: No validation that Start_Date__c is reasonable (not future date, not too far in past)
MEDIUM - Future Enhancement¶
- Multiple Active Memberships: Logic doesn't account for overlapping active memberships
- Historical Data: No mechanism to backfill continuous membership dates for existing members
- Audit Trail: No logging of continuous membership date changes
LOW - Monitor¶
- Performance: Monitor bulk membership updates that could trigger many account updates
- Edge Cases: Watch for scenarios where membership dates might be backdated or corrected
Maintenance Notes¶
This flow implements critical membership business logic that affects member benefits and pricing calculations. The continuous membership date is likely used elsewhere in the system for determining long-term member privileges. Recommend quarterly review of membership status transitions and validation that continuous membership dates align with actual membership history. Consider adding comprehensive testing for various membership lifecycle scenarios.