Skip to content

Flow Name: On Subscription: Update Membership Related Record

Last Updated: 2024-12-18 Source Code: On_Subscription_Update_Membership_Records.flow-meta.xml

API Name: On_Subscription_Update_Membership_Records Status: Active Type: Custom Trigger: After Save on Subscription__c record updates

Business Purpose

Maintains data synchronization between subscription records and related membership records by automatically updating membership fields when subscription details change.

Process Flow

  1. Subscription Update: Triggers when Subscription__c record is updated
  2. Membership Lookup: Finds related Membership__c records where Subcription__c field equals current subscription ID
  3. Field Synchronization: Updates membership record with:
  4. Auto_Renew__c = Subscription's Auto_Renew__c value
  5. End_Date__c = Subscription's End_Date__c value
  6. Start_Date__c = Subscription's Start_Date__c value
📊 Click to view Process Flow Diagram
flowchart TD
    Start([Start: After Save on Subscription__c record updates]) --> Lookup[Lookup Related Data]

    Lookup --> Found{Data<br/>Found?}
    Found -->|No| End([End])
    Found -->|Yes| Calculate[Calculate/Determine Values]

    Calculate --> Update[Update Records]
    Update --> End

    style Start fill:#e1f5ff
    style Lookup fill:#f0e1ff
    style Found fill:#fff4e1
    style Calculate fill:#e1ffe1
    style Update fill:#ffe1e1
    style End fill:#e1f5ff

Key Business Rules

  • Only processes Subscription__c record updates (not creates)
  • Updates all related membership records that reference the subscription
  • Maintains data consistency between subscription and membership entities
  • Field mapping ensures membership reflects current subscription state

Dependencies

  • Subscription__c object with fields: Auto_Renew__c, End_Date__c, Start_Date__c
  • Membership__c object with fields: Subcription__c (lookup), Auto_Renew__c, End_Date__c, Start_Date__c

Changes

  • PR-31572: Update the fields on the membership record related to the subscription
  • PR-33033: Remove Path, update subscription from membership flow

⚠️ Pre-Go-Live Concerns

CRITICAL - Fix Before Go-Live

  • Field Name Typo: Membership filter uses "Subcription__c" (missing 's') - verify this is the correct field API name

HIGH - Address Soon After Go-Live

  • Bulk Update Performance: No safeguards against updating large numbers of membership records
  • Circular Updates: Potential for infinite loops if membership updates trigger subscription updates

MEDIUM - Future Enhancement

  • Add error handling for failed membership updates
  • Consider implementing selective field updates (only changed fields)
  • Add audit trail for membership synchronization
  • Validate subscription-membership relationships before updates

LOW - Monitor

  • Performance with high-volume subscription updates
  • Data consistency verification between subscriptions and memberships
  • Impact of removing "Path" functionality mentioned in PR-33033

Maintenance Notes

Simple synchronization flow but critical for data integrity. Monitor for bulk operation impacts and verify the field name spelling in the filter logic. Consider adding validation to prevent orphaned membership records.