A company needs an automation that updates the Follow-Up Status field to 'Urgent' on all active Service Subscriptions whenever a Customer Incident is marked as 'Critical'. An administrator creates an autolaunched flow that retrieves the collection of related Service Subscriptions.
How should the administrator configure the flow resources and data manipulation elements to update these records without exceeding governor limits?
- AIterate over the retrieved collection in a Loop element, update the Follow-Up Status field directly using an Update Records element inside the loop, and terminate the flow.
- Iterate through the collection with a Loop element, update each record variable with an Assignment element, add it to a new collection variable in a second Assignment element, and update the new collection with a single Update Records element after the loop.Cevap
- CConfigure a Fast Field Updates (before-save) flow to modify the related Service Subscription records directly before the triggering record is saved to the database.
- DUse an Assignment element to update the triggering Incident record and depend on system validation rules to cascade the field updates to the related Service Subscription records.
Cevap
Iterate through the collection with a Loop element, update each record variable with an Assignment element, add it to a new collection variable in a second Assignment element, and update the new collection with a single Update Records element after the loop.
The standard and efficient pattern for manipulating multiple records in Salesforce Flow requires iterating over the retrieved collection with a Loop element, modifying the record values in memory via Assignment elements, adding the updated items into a second collection variable, and executing a single Update Records element after the loop finishes. This ensures only one DML transaction is consumed regardless of how many records are processed.
Adım Adım Çözüm
Anahtar Kavram
Bulkification in Salesforce Flow using Loop, Assignment, and Collection Resources
Tahmini Süre:1m 15s