An administrator at Cloud Kicks is configuring an automation on the custom Onboarding Project object. When an Onboarding Project is marked as 'Expedited', the flow must find all related open Onboarding Task records and change their Priority to 'High'. Which design approach should the administrator use to update the task records efficiently without exceeding governor limits?
- Retrieve the open tasks with a Get Records element, iterate through them in a Loop, modify the field values and add each record to a new collection using Assignment elements, and execute a single Update Records element on the collection after the loop finishes.Cevap
- BRetrieve the open tasks with a Get Records element, loop through the collection, and execute an Update Records element inside the loop on each iteration to commit changes immediately.
- CConfigure the automation as a Fast Field Updates (before-save) record-triggered flow and use an Assignment element to write updates directly to the related child records without a DML element.
- DUse a Get Records element inside the loop to fetch each related task record individually, apply the field changes, and rely on system validation rules to commit the updates automatically.
Cevap
Retrieve the open tasks with a Get Records element, iterate through them in a Loop, modify the field values and add each record to a new collection using Assignment elements, and execute a single Update Records element on the collection after the loop finishes.
The correct approach follows Salesforce bulkification standards: records are fetched in a single query, modified in memory through loop iterations and Assignment elements, and committed using a single Update Records DML element pointing to the collection variable after the loop concludes.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification and Collection Manipulation
Tahmini Süre:1m 15s