Skip to content

Flow Name: Create Fellow Fee on New Membership

Last Updated: 2025-06-05 Source Code: Create_Fellow_Fee_on_New_Membership.flow-meta.xml

API Name: Create_Fellow_Fee_on_New_Membership Status: Active Type: Custom Trigger: Record-triggered flow on OrderItem creation (after save)

Business Purpose

Automatically adds appropriate Fellow fees to membership orders when the account holder is designated as a Fellow. Different fee products are selected based on Fellow type (Regular, Lifetime, Retired, or Waived).

Process Flow

  1. Trigger Conditions: Fires when OrderItem created for Membership product on Manual Orders
  2. Get Order Details: Retrieves order information including recurring payment details
  3. Auto-Renewal Check: Skips fellow fee creation for auto-renewing orders (2+ transactions)
  4. Get Account Information: Pulls Fellow status and designation from related Account
  5. Determine Fellow Fee Type: Based on Fellow_Designation__c field:
  6. Regular → P-FELO-074 (Regular Fellowship Fee)
  7. Lifetime → P-FELO-083 (Lifetime Fellowship Fee)
  8. Retired → P-FELO-075 (Retired Fellowship Fee)
  9. Other/Waived → P-FELO-076 (Waived Fellowship Fee - $0)
  10. Get Fellow Fee Product: Looks up product by SKU from Fellows Fees pricebook
  11. Pricebook Entry Lookup: Finds appropriate price for the product
  12. Create Fellow Fee OrderItem: Adds fee product to the order with:
  13. Type set to "Fee"
  14. Quantity of 1
  15. Price from Fellows Fees pricebook
  16. Same dates as original membership item
📊 Click to view Process Flow Diagram
flowchart TD
    Start([Start: Record-triggered flow on OrderItem creation (after save)]) --> 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 triggers on Membership family products
  • Only for Manual Orders (not auto-generated)
  • Skips auto-renewal orders (orders with 2+ transactions)
  • Different SKUs for different Fellow types
  • Uses separate "Fellows Fees" pricebook for pricing
  • Creates error if Fellow fee product not found in order's pricebook
  • For auto-renewals, bypasses pricebook validation

Dependencies

  • Account.Is_a_Fellow__c and Fellow_Designation__c fields
  • Product2 records with specific SKUs (P-FELO-074, 075, 076, 083)
  • "Fellows Fees" pricebook
  • PricebookEntry records linking products to pricebooks
  • ChargentOrders__ChargentOrder__c for recurring order detection

Changes

  • PR-33047: Initial implementation
  • PR-34264: Correct Pricebook handling

⚠️ Pre-Go-Live Concerns

CRITICAL - Fix Before Go-Live

  • Hardcoded SKUs: Fellow fee product SKUs are hardcoded - changes require flow updates
  • Missing Fellow products: Flow fails with custom error if Fellow fee products missing from pricebook
  • Pricebook dependency: Requires "Fellows Fees" pricebook to exist with correct name

HIGH - Address Soon After Go-Live

  • Auto-renewal logic: Complex logic for detecting auto-renewals may miss edge cases
  • No duplicate prevention: Could potentially create multiple Fellow fees on same order
  • Fellow status changes: Doesn't handle changes to Fellow status after order creation

MEDIUM - Future Enhancement

  • Hardcoded pricebook name: "Fellows Fees" pricebook name is hardcoded
  • Limited Fellow types: Only handles 4 Fellow designation types
  • No proration logic: Doesn't handle partial year memberships

LOW - Monitor

  • Trigger order: Set to run at order 200 - may need adjustment based on other flows
  • Error messaging: Could provide more specific guidance for missing products

Maintenance Notes

Complexity: High - Complex business logic with multiple lookups and pricebook dependencies. Review when adding new Fellow types or changing fee structure. Monitor for errors related to missing products or pricebook entries. Test thoroughly when Fellowship program rules change.