An administrator is configuring a flow to update all open Support Case records associated with an Account when its support tier is upgraded. The flow uses a Get Records element to retrieve the related open cases and iterates through them using a Loop element to set their Priority field to 'High'. What should the administrator do within the loop to prepare the records for update without exceeding Salesforce governor limits?
- Modify the current loop item's Priority field using an Assignment element, and then use a second Assignment element to add the current loop item to a new record collection variable.Cevap
- BPlace an Update Records element inside the loop to save the updated Priority value to Salesforce during each iteration.
- CUse a Get Records element inside the loop to re-fetch the Case record before updating its Priority field with an Assignment element.
- DUse a Decision element inside the loop to execute an Update Records element only on every second iteration.
Cevap
Modify the current loop item's field values using an Assignment element, append the current loop item to a record collection variable using a second Assignment element, and execute a single Update Records element after the loop completes.
The correct practice for manipulating data inside a Flow loop is to update field values on the current record item using an Assignment element, and then use another Assignment element to add that record item into a record collection variable. After the loop completes, a single Update Records element is executed on the collection variable, adhering strictly to Salesforce governor limit and bulkification guidelines.
Adım Adım Çözüm
Anahtar Kavram
Bulkification in Salesforce Flow using Assignment elements and Record Collections
Tahmini Süre:1m 30s