Global Freight Solutions requires an automated solution on the custom object Freight_Shipment__c when a record's status is updated to 'Dispatched'. The solution must fulfill three operational requirements:
1. Standardize and populate the custom field Formatted_Routing_Code__c on the triggering Freight_Shipment__c record prior to the database commit.
2. Update the Status__c field on all associated child Shipment_Item__c records to 'In Transit'.
3. Execute an HTTP callout to send shipment payload details to an external third-party logistics REST API.
Which combination of flow trigger configurations adheres to Salesforce performance and architecture best practices?
- Implement a Before-Save Record-Triggered Flow (Fast Field Updates) to populate Formatted_Routing_Code__c on the triggering record, and a separate After-Save Record-Triggered Flow (Actions and Related Records) utilizing an Asynchronous Path to update child Shipment_Item__c records and execute the external HTTP callout.Cevap
- BImplement a single After-Save Record-Triggered Flow (Actions and Related Records) that updates Formatted_Routing_Code__c using an Update Records element, updates child Shipment_Item__c records, and performs the HTTP callout synchronously on the main execution path.
- CImplement a single After-Save Record-Triggered Flow that uses a Loop element to iterate through child Shipment_Item__c records, placing a Get Records and Update Records element inside the loop to update each child record and execute the HTTP callout.
- DImplement a single Before-Save Record-Triggered Flow (Fast Field Updates) that updates Formatted_Routing_Code__c, performs a mass update on child Shipment_Item__c records, and executes an Apex action to invoke the external HTTP callout.
Cevap
Implement a Before-Save Record-Triggered Flow (Fast Field Updates) for same-record updates, alongside an After-Save Record-Triggered Flow with an Asynchronous Path for related record updates and external callouts.
The solution properly separates responsibilities according to Salesforce architectural guidelines. A Before-Save (Fast Field Updates) flow optimizes same-record updates by setting values in memory before saving to the database without additional DML calls. An After-Save flow using an Asynchronous Path allows related record updates and handles external HTTP callouts in a background thread, preventing callout governor limit exceptions.
Adım Adım Çözüm
Anahtar Kavram
Record-Triggered Flow Trigger Optimization & Asynchronous Execution Architecture