An administrator is configuring a flow to update the status of multiple child Invoice Line Item records to 'Voided' whenever a parent Invoice is cancelled. To ensure data manipulation operations adhere to governor limits and Salesforce best practices for flow resources, what is the correct sequential order to configure the Flow Builder elements?
- 1Query and retrieve all related Invoice Line Item records into a record collection variable using a Get Records element.
- 2Iterate through the retrieved record collection variable using a Loop element.
- 3Set the Status field to 'Voided' on the current loop item variable using an Assignment element.
- 4Add the modified loop item variable to a new record collection variable using an Assignment element.
- 5Commit all updates to the database with a single Update Records element pointing to the new collection variable outside the loop.
Answer
Query records with Get Records, loop over the collection, assign field values to the current item, add the current item to a new collection, and perform a single Update Records element on the new collection outside the loop.
The correct pattern follows standard bulkification principles in Flow Builder: first retrieve data with Get Records, iterate through the collection with a Loop, modify fields in memory using an Assignment element, stage the modified record into a secondary collection variable with another Assignment element, and finally commit the entire collection via an Update Records element after the loop path completes.
Step-by-Step Solution
Key Concept
Bulkified Flow Data Manipulation and Collection Resources
Estimated Time:1m 30s