Skip to content

Flow Name: [AANP][RTF] Update Order Item Subscription Dates

Last Updated: 2025-10-22 Source Code: https://github.com/AANP-IT/I2C.Salesforce.Metadata/blob/STAGING/force-app/main/default/flows/AANP_RTF_Update_Order_Item_Subscription_Dates.flow-meta.xml

API Name: AANP_RTF_Update_Order_Item_Subscription_Dates Status: Active Type: Custom Trigger: After subscription record is created or updated (when Start Date, End Date, or Order Product changes)

Business Purpose

This flow synchronizes subscription date information with related order items by updating OrderItem records when subscription start/end dates change. It ensures that subscription timing data is properly reflected in the order management system for accurate billing and fulfillment.

Process Flow

  1. Trigger Evaluation: Flow activates when subscription dates or order product link changes
  2. Order Item Update: Updates the related OrderItem with:
  3. Subscription Start Date from the subscription record
  4. Subscription End Date from the subscription record
  5. Completion: Date synchronization is complete
📊 Click to view Process Flow Diagram
flowchart TD
    Start([Start: Subscription Create/Update]) --> Decision{Field Changed?<br/>Start Date OR<br/>End Date OR<br/>Order Product Link}

    Decision -->|Yes| Update[Update Related OrderItem:<br/>Sync Subscription Dates]
    Decision -->|No| End([End])

    Update --> End

    style Start fill:#e1f5ff
    style Decision fill:#fff4e1
    style Update fill:#ffe1e1
    style End fill:#e1f5ff

Key Business Rules

  • Only triggers when subscription date fields or Order Product link changes
  • Updates OrderItem with matching subscription dates
  • Maintains data consistency between Subscription and OrderItem records
  • Uses direct lookup relationship to find related OrderItem

Dependencies

  • Objects: Subscription__c, OrderItem
  • Fields:
  • Subscription__c: Start_Date__c, End_Date__c, Order_Product__c
  • OrderItem: Subscription_Start_Date__c, Subscription_End_Date__c
  • Relationships: Subscription to OrderItem via Order_Product__c lookup

Changes

No specific pull requests or changes documented in flow metadata.

⚠️ Pre-Go-Live Concerns

CRITICAL - Fix Before Go-Live

None identified.

HIGH - Address Soon After Go-Live

  • No error handling if OrderItem is not found via Order_Product__c lookup
  • Could fail silently if the relationship is broken

MEDIUM - Future Enhancement

  • Monitor performance with high-volume subscription updates
  • Consider adding validation to ensure dates are in logical sequence
  • May need optimization for bulk operations

LOW - Monitor

  • Simple field mapping may not account for future complex business rules
  • Consider logging for audit trail of date changes

Maintenance Notes

  • Complexity: Low - straightforward field synchronization
  • Review Schedule: Annually or when subscription/order processes change
  • Testing Focus: Test bulk updates and edge cases where Order_Product__c is null or invalid