A Salesforce Administrator is designing an autolaunched flow to update all child Contact records whenever a parent Account's status changes. To adhere strictly to bulkification best practices and prevent hitting governor limits, in what precise order should the administrator execute the Flow Builder elements?
- 1Execute a Get Records element outside of any loop to retrieve all child Contact records whose AccountId matches the collection of updated Account IDs.
- 2Pass the retrieved Contact collection into a Loop element to iterate through individual record items.
- 3Use an Assignment element inside the loop to set updated field values on the current loop record variable.
- 4Use a second Assignment element inside the loop to add the modified loop record variable to a new Record Collection variable.
- 5Execute an Update Records element after the loop finishes, passing the new Record Collection variable into the DML operation.
Answer
The correct bulkified sequence begins by getting child Contact records into a collection, iterating through them with a Loop element, updating field values on the current item with an Assignment element, appending that item to a secondary collection with another Assignment element, and finally executing a single Update Records DML operation outside the loop.
The design pattern for bulkified Flow processing requires data retrieval (Get Records) prior to entering a loop, in-memory updates and staging (Assignment elements) inside the loop, and a single bulk write operation (Update Records) after the loop path completes.
Step-by-Step Solution
Key Concept
Bulkification in Flow Builder