A company requires an automated process on the Case object. When a Case status is updated to 'Closed', all associated open Task records must have their status changed to 'Completed'. To maintain system efficiency and prevent reaching governor limits during bulk updates, which design pattern and element structure should be used in Flow Builder?
- Retrieve open Tasks with a Get Records element, loop through the collection, update each Task item's fields and add it to a output collection variable using an Assignment element inside the loop, then execute a single Update Records element outside the loop.Cevap
- BRetrieve open Tasks with a Get Records element, loop through the record collection, and place an Update Records element inside the loop to save each Task record immediately upon modification.
- CCreate a Roll-Up Summary field on the Case object to count open Tasks, then use a Decision element to update child Tasks directly without using a collection variable.
- DLoop through the Task records and use an Assignment element inside the loop to update the available picklist values assigned to the Task record type.
Cevap
Retrieve open Tasks using a Get Records element, loop through the collection, update field values and append items to a new collection using an Assignment element inside the loop, and place a single Update Records element outside the loop.
The correct approach uses a Get Records element to retrieve all related open Tasks into a collection, iterates through the collection using a Loop element, uses Assignment elements inside the loop to modify field values in memory and stage them into a output collection, and finally uses a single Update Records element outside the loop to commit all updates to the database in a single transaction.
Adım Adım Çözüm
Anahtar Kavram
Bulkification in Flow Builder using collections, loops, and external DML elements