A Salesforce Administrator is creating an after-save record-triggered flow on the Account object to update the mailing address on all child Contact records whenever an Account address changes. To adhere to Salesforce bulkification design principles and prevent hitting governor limits, in which sequence should the administrator execute the flow steps?
- 1Execute a Get Records element to query all Contact records where AccountId equals the triggering Account ID.
- 2Pass the retrieved Contact collection into a Loop element to process each Contact record individually.
- 3Use an Assignment element inside the loop to set the new address values on the current loop Contact item.
- 4Use a second Assignment element inside the loop to add the current loop Contact item to a new Contact Record Collection variable.
- 5Execute an Update Records element outside the loop, passing the new Contact Record Collection variable.
Cevap
The correct bulkified execution sequence is: 1) Query child Contact records using Get Records, 2) Iterate over the collection with a Loop element, 3) Update field values on the current record using an Assignment element inside the loop, 4) Add the updated record to a target collection variable using a second Assignment element inside the loop, and 5) Execute an Update Records element on the target collection outside of the loop.
The standard bulkification design pattern in Salesforce Flow Builder requires retrieving records once using Get Records, iterating through the collection with a Loop, updating fields on the current item in an Assignment, appending that item to an update collection in a second Assignment, and executing a single Update Records DML operation on the collection after the loop completes.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification Pattern (SOQL/DML outside Loops)