Flow Name: [I2C] Update Account Attestation Dates¶
Last Updated: 2025-10-08 Source Code: I2C_Update_Account_Attestation_Dates.flow-meta.xml
API Name: I2C_Update_Account_Attestation_Dates Status: Active Type: Custom Trigger: After Account update when attestation checkboxes or membership status changes
Business Purpose¶
Maintains the integrity of faculty and preceptor attestation data by automatically managing attestation dates when checkboxes are toggled or when membership expires, ensuring accurate tracking of member certifications.
Process Flow¶
- Triggers when specific fields change on Account:
- Membership status changes to Expired (from Active or Grace Period)
- Profile_Faculty_Attestation__c checkbox changes
-
Profile_Preceptor_Attestation__c checkbox changes
-
Membership Expiration Path:
- If status changes to Expired from Active or Within Grace Period
-
Clears BOTH faculty and preceptor attestation dates and checkboxes
-
Faculty Attestation Path:
- If checkbox changed to TRUE: Sets Profile_Faculty_Attestation_Date__c to current date
-
If checkbox changed to FALSE: Clears Profile_Faculty_Attestation_Date__c
-
Preceptor Attestation Path:
- If checkbox changed to TRUE: Sets Profile_Preceptor_Attestation_Date__c to current date
-
If checkbox changed to FALSE: Clears Profile_Preceptor_Attestation_Date__c
-
Updates using SafeUpdateService for error handling
📊 Click to view Process Flow Diagram
flowchart TD
Start([Start: Account Update<br/>After Save]) --> Decision{Check Scenario}
Decision -->|Membership Active/Grace → Expired| ClearBoth[Clear Both Attestations:<br/>• Faculty Attestation = false<br/>• Preceptor Attestation = false<br/>• Clear both dates]
Decision -->|Faculty Attestation Changed| FacultyCheck{Faculty = true?}
Decision -->|Preceptor Attestation Changed| PreceptorCheck{Preceptor = true?}
Decision -->|No Match| End([End])
FacultyCheck -->|True| PopulateFaculty[Set Faculty Date:<br/>Profile_Faculty_Attestation_Date__c = Today]
FacultyCheck -->|False| ClearFaculty[Clear Faculty Date:<br/>Profile_Faculty_Attestation_Date__c = null<br/>Faculty Attestation = false]
PreceptorCheck -->|True| PopulatePreceptor[Set Preceptor Date:<br/>Profile_Preceptor_Attestation_Date__c = Today]
PreceptorCheck -->|False| ClearPreceptor[Clear Preceptor Date:<br/>Profile_Preceptor_Attestation_Date__c = null<br/>Preceptor Attestation = false]
ClearBoth --> UpdateBoth[Safe Update Account Record]
PopulateFaculty --> UpdateFaculty[Safe Update Account Record]
ClearFaculty --> UpdateFaculty2[Safe Update Account Record]
PopulatePreceptor --> UpdatePreceptor[Safe Update Account Record]
ClearPreceptor --> UpdatePreceptor2[Safe Update Account Record]
UpdateBoth --> End
UpdateFaculty --> End
UpdateFaculty2 --> End
UpdatePreceptor --> End
UpdatePreceptor2 --> End
style Start fill:#e1f5ff
style Decision fill:#fff4e1
style FacultyCheck fill:#fff4e1
style PreceptorCheck fill:#fff4e1
style PopulateFaculty fill:#e1ffe1
style PopulatePreceptor fill:#e1ffe1
style ClearBoth fill:#e1ffe1
style ClearFaculty fill:#e1ffe1
style ClearPreceptor fill:#e1ffe1
style UpdateBoth fill:#ffe1e1
style UpdateFaculty fill:#ffe1e1
style UpdateFaculty2 fill:#ffe1e1
style UpdatePreceptor fill:#ffe1e1
style UpdatePreceptor2 fill:#ffe1e1
style End fill:#e1f5ff
Key Business Rules¶
- Membership Expiration Logic: (Active→Expired) OR (Within Grace period→Expired)
- Attestations are automatically cleared when membership expires
- Attestation dates are set to "today" when checkbox is enabled
- Attestation dates are cleared when checkbox is disabled
- Uses SafeUpdateService apex class to handle errors gracefully
- Each attestation type (Faculty/Preceptor) is independent
Dependencies¶
- Objects: Account (standard with custom fields)
- Fields:
- Membership_status__c (picklist)
- Profile_Faculty_Attestation__c
- Profile_Faculty_Attestation_Date__c
- Profile_Preceptor_Attestation__c
- Profile_Preceptor_Attestation_Date__c
- Apex Classes: SafeUpdateService
- Related Flows: I2C_Scheduled_Account_Attestation_Checkboxes_Expiration_Automation
Changes¶
No Pull Request references found in metadata.
⚠️ Pre-Go-Live Concerns¶
CRITICAL - Fix Before Go-Live¶
- No User Notification: When membership expires, users don't know their attestations were cleared
- Irreversible Action: Clearing attestation dates on expiration loses historical data - should archive instead
- Multiple Updates: Three separate SafeUpdateService calls could cause performance issues
HIGH - Address Soon After Go-Live¶
- Data Loss: Original attestation dates are lost when cleared - consider archiving in a separate field
- Audit Trail: No tracking of who changed attestations or when they were auto-cleared
- Bulk Operations: Multiple checkbox changes in bulk could trigger excessive DML operations
MEDIUM - Future Enhancement¶
- Consolidate Updates: Combine three separate SafeUpdateService calls into single update operation
- Validation Rules: Add validation to prevent manual attestation date changes without checkbox
- History Tracking: Enable field history tracking for attestation fields
LOW - Monitor¶
- Error Logs: Regularly review SafeUpdateService error logs for failed updates
- User Confusion: Monitor help desk tickets related to missing attestation dates
- Edge Cases: Verify behavior when membership status changes rapidly (Active→Grace→Expired)
Maintenance Notes¶
Complexity: Medium - Multiple decision paths with complex filter logic Review Schedule: Quarterly review when attestation policies are reviewed Critical for Compliance: Attestation tracking is likely required for regulatory compliance Performance: After-save trigger with multiple potential DML operations - monitor carefully