Skip to content

Flow Name: [I2C] Deactivate PAC Subscriptions and Recurring Orders for Non-US Address

Last Updated: 2025-07-01 Source Code: I2C_Deactivate_PAC_Subscriptions_and_Recurring_Orders_for_Non_US_Address.flow-meta.xml

API Name: I2C_Deactivate_PAC_Subscriptions_and_Recurring_Orders_for_Non_US_Address Status: Active Type: Custom Trigger: Record-triggered flow on Account update (after save)

Business Purpose

Automatically deactivates PAC (Political Action Committee) contribution subscriptions and recurring orders when an account's address changes from US to non-US, or when membership expires, due to legal restrictions on foreign political contributions.

Process Flow

  1. Trigger Conditions: Fires when Account is updated with either:
  2. PersonMailingCountry changes from "United States" to non-US
  3. Membership_status__c changes to "Expired" from "Active" or "Within Grace period"
  4. Get PAC Products: Retrieves PAC contribution products by SKU:
  5. P-PAC-998, P-PAC-997, P-PAC-032
  6. Collect Product IDs: Transforms product records to collection of IDs
  7. Get Active PAC Subscriptions: Finds all Active subscriptions for the account with PAC products
  8. Loop Subscriptions: For each active subscription:
  9. Sets Status to "Expired"
  10. Adds to collection for bulk update
  11. Update Subscriptions: Bulk updates all PAC subscriptions to Expired status
  12. Get PAC Recurring Orders: Finds recurring ChargentOrders with:
  13. Monthly, Quarterly, or Annual frequency
  14. Recurring PAC flag set to true
  15. "Recurring" payment status
  16. Loop Recurring Orders: For each recurring order:
  17. Sets Payment Status to "Stopped"
  18. Adds to collection for bulk update
  19. Update Recurring Orders: Bulk updates all PAC recurring orders to Stopped status
  20. Error Handling: Shows specific errors for subscription or order update failures
📊 Click to view Process Flow Diagram
flowchart TD
    Start([Start: Record-triggered flow on Account update (after save)]) --> Check{Entry Criteria<br/>Met?}

    Check -->|No| End([End])
    Check -->|Yes| Process[Execute Business Logic]

    Process --> Update[Update Records]
    Update --> End

    style Start fill:#e1f5ff
    style Check fill:#fff4e1
    style Process fill:#e1ffe1
    style Update fill:#ffe1e1
    style End fill:#e1f5ff

Key Business Rules

  • Only affects PAC contribution products (specific SKUs)
  • Triggers on address change from US to non-US
  • Also triggers on membership expiration
  • Changes subscription status from "Active" to "Expired"
  • Changes recurring order status from "Recurring" to "Stopped"
  • Uses bulk operations for performance
  • Processes both subscriptions and recurring orders

Dependencies

  • Account.PersonMailingCountry and Membership_status__c fields
  • Product2 records with PAC SKUs (P-PAC-998, P-PAC-997, P-PAC-032)
  • Subscription__c object with Status__c field
  • ChargentOrders__ChargentOrder__c with ChargentOrders_Recurring_Pac__c flag
  • ChargentOrders__Payment_Status__c and ChargentOrders__Payment_Frequency__c fields

Changes

None explicitly noted in the flow

⚠️ Pre-Go-Live Concerns

CRITICAL - Fix Before Go-Live

  • Legal compliance: Must ensure this flow prevents foreign political contributions - failure could result in legal violations
  • Hardcoded SKUs: PAC product identification relies on hardcoded SKUs - missing products could bypass legal controls
  • Address validation: Only checks mailing country - doesn't validate if address change is legitimate

HIGH - Address Soon After Go-Live

  • No reversal logic: No mechanism to reactivate if address is corrected back to US
  • No notification: Account holders aren't notified of PAC contribution cancellation
  • Bulk operation failures: If bulk updates fail, some PAC contributions might continue

MEDIUM - Future Enhancement

  • Limited address triggers: Only handles mailing address - doesn't check billing address
  • No audit trail: Doesn't log who triggered the deactivation or reason
  • Manual intervention: No process for exceptions or appeals

LOW - Monitor

  • Performance: Multiple bulk operations could impact performance with large data volumes
  • Edge cases: Doesn't handle scenarios like temporary international addresses

Maintenance Notes

Complexity: High - Critical for legal compliance with political contribution laws. Requires immediate attention if any failures occur. Review regularly to ensure all PAC products are properly identified and that legal requirements haven't changed. Test thoroughly when adding new PAC products or changing address handling logic.