Universal Containers needs an automated process that closes all open Task records associated with a custom Project object whenever the Project status changes to 'Completed'. Because a single Project record can have dozens of open tasks, the solution must handle the updates efficiently without exceeding SOQL or DML limits.
Which flow design pattern should the administrator use to update these related records?
- AUse a before-save record-triggered flow on the Project object to update the related Task records directly in the global $Record variable.
- Retrieve the related tasks into a collection, iterate over them in a Loop, assign updated field values to a new collection variable, and execute one Update Records element after the loop finishes.Cevap
- CQuery the tasks into a record collection, iterate through them with a Loop, and perform an Update Records operation within each iteration to commit changes immediately.
- DLoop through the related task IDs, invoke a Get Records element during each pass to fetch field values, update the fields, and save each record individually.
Cevap
Retrieve the related tasks into a collection, iterate over them in a Loop, assign updated field values to a new collection variable, and execute one Update Records element after the loop finishes.
Bulkification in Salesforce Flow requires managing data manipulation outside of loops. The recommended pattern involves gathering records into a collection, updating field values across loop iterations into an output collection variable using Assignment elements, and executing a single Update Records DML element after the loop has concluded.
Adım Adım Çözüm
Anahtar Kavram
Flow bulkification, collection variables, and DML handling outside loop elements
Tahmini Süre:1m 15s