An administrator is designing a flow to update the status of multiple child Inspection Finding records to 'Resolved' whenever a parent Building Inspection record is finalized. The flow must process potentially hundreds of records without hitting Salesforce governor limits. Which two design actions should the administrator take in Flow Builder to manipulate and commit these records efficiently? (Choose two.)
- Use an Assignment element inside the loop to add each modified record variable to a new record collection variable.Answer
- BPlace an Update Records element inside the loop to commit each Inspection Finding status change as it is processed.
- Place a single Update Records element after the loop finishes to update the entire record collection variable in a single operation.Answer
- DPlace a Get Records element inside the loop to re-query and lock each Inspection Finding record before modifying its fields.
Answer
Use an Assignment element within the loop to populate a record collection variable, and execute a single Update Records element after the loop completes.
To adhere to Salesforce bulkification best practices and avoid hitting governor limits, database operations must never be placed inside loops. Instead, administrators should loop through records, make field modifications in memory using Assignment elements to build a collection variable, and execute a single Update Records DML operation after the loop has finished processing all items.
Step-by-Step Solution
Key Concept
Bulkification in Flow Builder using Record Collection Variables and Assignment Elements
Estimated Time:1m 15s