Skip to content

Flow Name: On Membership Expired: Reassign Buyer Groups

Last Updated: 2025-08-13 Source Code: On_Membership_Expired_Reassign_Buyer_Groups.flow-meta.xml

API Name: On_Membership_Expired_Reassign_Buyer_Groups Status: Obsolete Type: Custom Trigger: After Membership__c update when Status changes to Expired

Business Purpose

Manages buyer group assignments when memberships expire by removing active member buyer groups and reassigning to appropriate non-member or general buyer groups based on membership history. Referenced PR-29952 for Individual Non Member logic and Account field updates.

Process Flow

  1. Triggers when Membership Status__c changes to "Expired"
  2. Validates membership is the actual active membership (AANP_Membership__c or Fellow_Membership__c)
  3. Retrieves all existing BuyerGroupMember records for the account
  4. Loops through and identifies buyer groups to delete:
  5. Non-Fellow groups when Product Family is Membership
  6. Fellow groups when Product Family is Fellows Dues
  7. Deletes obsolete buyer group assignments
  8. Reassigns based on membership category:
  9. Individual Non Member: Creates assignment to "Individual Non Member" buyer group
  10. All Others: Creates assignment to "General Buyer group"
  11. Validates buyer group assignments don't already exist before creating
📊 Click to view Process Flow Diagram
flowchart TD
    Start([Start: Membership Expired]) --> Validate{Is Actual<br/>Membership?}
    Validate -->|No| End([End])
    Validate -->|Yes| GetBuyerGroups[Get Buyer Group Members]
    GetBuyerGroups --> Loop[Loop Through Members]
    Loop --> Delete[Delete Obsolete Groups]
    Delete --> CheckCategory{Membership<br/>Category?}
    CheckCategory -->|Individual| Individual[Assign Individual Non Member Group]
    CheckCategory -->|Other| General[Assign General Buyer Group]
    Individual --> End
    General --> End

    style Start fill:#e1f5ff
    style Validate fill:#fff4e1
    style GetBuyerGroups fill:#e1ffe1
    style Loop fill:#fff4e1
    style Delete fill:#ffe1e1
    style CheckCategory fill:#fff4e1
    style Individual fill:#ffe1e1
    style General fill:#ffe1e1
    style End fill:#e1f5ff

Key Business Rules

  • Only processes "actual" memberships (linked to Account's AANP_Membership__c or Fellow_Membership__c)
  • Deletion logic: ((NOT Fellow) AND Membership) OR (Fellow AND Fellows Dues)
  • Individual members get "Individual Non Member" group
  • All others get "General Buyer group"
  • Prevents duplicate buyer group assignments
  • Includes null check on delete operation (PR-29952)

Dependencies

  • Objects: Membership__c, BuyerGroupMember, BuyerGroup (standard), Account
  • Fields:
  • Status__c, Account_Name__c, Product_Family__c
  • Membership_Category__c, AANP_Membership__c, Fellow_Membership__c
  • Buyer Groups: "Individual Non Member", "General Buyer group", "Fellow Buyer Group"

Changes

PR-29952: Added logic to update Account fields when membership status is expired, membership category = Individual Non Member and Type = "Former Member". Added null check to Delete operation.

⚠️ Pre-Go-Live Concerns

CRITICAL - Fix Before Go-Live

  • FLOW IS OBSOLETE: This flow is marked as Obsolete - verify replacement flow is active
  • Missing Error Handling: No fault paths configured for buyer group creation/deletion failures
  • Hardcoded Values: Buyer group names are hardcoded - should use Custom Metadata

HIGH - Address Soon After Go-Live

  • Not Applicable: Flow is Obsolete and should not be deployed

MEDIUM - Future Enhancement

  • Not Applicable: Flow is Obsolete

LOW - Monitor

  • Not Applicable: Flow is Obsolete

Maintenance Notes

Complexity: Medium - Multiple decision paths with loop iteration and DML operations Status: OBSOLETE - Do not activate this flow Replacement: Verify that On_Person_Account_Members_Buyer_Groups_assignment or similar flow handles this functionality Archive Recommendation: Consider deleting this flow if replacement is confirmed and working