A logistics enterprise uses a custom object named Freight Shipment to track international deliveries. The operations team has defined two requirements when a Freight Shipment record is updated:
1. Automatically calculate and update the Estimated Delivery Date and Risk Status fields on the triggering Freight Shipment record prior to saving changes to the database.
2. If the shipment status is updated to 'Delayed', automatically create a related Audit Task record assigned to the logistics manager.
Which automation design adheres to Salesforce architecture best practices while optimizing performance?
- Implement a before-save Record-Triggered Flow (Fast Field Updates) for updating the Freight Shipment fields, and an after-save Record-Triggered Flow (Actions and Related Records) to create the Audit Task record.Cevap
- BImplement a single after-save Record-Triggered Flow (Actions and Related Records) that performs an explicit Update Records DML element on the triggering Freight Shipment record and creates the Audit Task record.
- CImplement a Record-Triggered Flow that retrieves related Freight Shipment records, loops through them, and executes an Update Records DML element inside the loop to recalculate field values.
- DImplement a Roll-Up Summary field on the parent Account object linked via a Lookup relationship to automatically trigger field updates and task creation on the Freight Shipment record.
Cevap
Implement a before-save Record-Triggered Flow (Fast Field Updates) for updating the Freight Shipment fields, and an after-save Record-Triggered Flow (Actions and Related Records) to create the Audit Task record.
The requirement specifies modifying fields on the triggering record as well as creating a related Audit Task record. Salesforce best practice dictates using a before-save Record-Triggered Flow (Fast Field Updates) to modify fields on the triggering record without incurring extra DML overhead, and using an after-save Record-Triggered Flow (Actions and Related Records) to create related records after the primary record has been committed to the database.
Adım Adım Çözüm
Anahtar Kavram
Selecting optimal Record-Triggered Flow trigger types (Fast Field Updates vs. Actions and Related Records) based on execution timing and target record context.