Flow Name: Business Account Pre-Save Update: Business Region/Territory¶
Last Updated: 2024-11-14 Source Code: Business_Account_before_insert_update.flow-meta.xml
API Name: Business_Account_before_insert_update Status: Active Type: Custom Trigger: Before save (create and update) of Business Account records
Business Purpose¶
This flow ensures data consistency on Business Accounts by automatically managing the Business_Region_Territory__c field based on country classification. It clears the regional territory field for US-based business accounts while preserving territory information for international accounts, maintaining clean geographic categorization.
Process Flow¶
- Trigger Check: Only processes Business Account records (IsPersonAccount = false)
- Change Detection: Evaluates if Business_Address__CountryCode__s or Business_Region_Territory__c fields have changed
- Formula Calculation:
- Territory Logic: Clears Business_Region_Territory__c if Business_Address__CountryCode__s equals "US"
- International Logic: Preserves existing Business_Region_Territory__c value for non-US accounts
- Field Update: Updates the calculated Business_Region_Territory__c field on the current record
📊 Click to view Process Flow Diagram
flowchart TD
Start([Start: Account Create/Update<br/>Before Save Trigger]) --> EntryCheck{Is Business Account<br/>AND<br/>Key Field Changed?}
EntryCheck -->|No| End([End])
EntryCheck -->|Yes| Calculate[Calculate Territory:<br/>Business_Region_Territory__c =<br/>blank if Country = US<br/>else preserve current value]
Calculate --> Update[Update Record Field:<br/>Business_Region_Territory__c]
Update --> End
style Start fill:#e1f5ff
style EntryCheck fill:#fff4e1
style Calculate fill:#e1ffe1
style Update fill:#ffe1e1
style End fill:#e1f5ff
Key Business Rules¶
- Only applies to Business Account records (non-person accounts)
- Business_Region_Territory__c is cleared when Business_Address__CountryCode__s equals "US"
- International accounts (non-US) retain their existing territory values
- Process runs on both create and update operations
- Updates occur before the record is saved (before trigger)
Dependencies¶
- Account standard object with IsPersonAccount flag
- Custom fields: Business_Region_Territory__c, Business_Address__CountryCode__s on Account
- PR-31190 (referenced in description)
- Geographic/regional business processes that depend on territory classification
⚠️ Pre-Go-Live Concerns¶
CRITICAL - Fix Before Go-Live¶
- Data Loss Risk: Business_Region_Territory__c is blanked for ALL US business accounts - verify this aligns with business requirements
- Field Validation: No validation that territory values are from expected picklist or lookup
HIGH - Address Soon After Go-Live¶
- Business Logic Verification: Confirm clearing territory for US business accounts doesn't break regional reporting or processes
- Data Migration: Existing US business accounts with territories will lose this data on next update
MEDIUM - Future Enhancement¶
- Optimization: Could add null checks to avoid unnecessary updates when territory is already blank
- Audit Trail: No logging of changes made by this automation
LOW - Monitor¶
- Geographic Logic: Formula assumes US accounts don't need territory classification - verify this remains accurate
- Field Dependencies: Monitor for downstream processes that might depend on territory data for US accounts
Maintenance Notes¶
Complexity: Low - Simple field update logic with clear geographic business rules. Review semi-annually to ensure country-based territory logic remains accurate for business requirements. Monitor for any international expansion that might affect business territory management.