An administrator needs to build a Flow to update the status on multiple Case records based on user input. To ensure the flow operates efficiently without exceeding Salesforce governor limits, what should the administrator do?
- Use an Assignment element inside a Loop to populate a Record Collection Variable, and place a single Update Records element outside the Loop.Answer
- BPlace an Update Records element inside the Loop element to update each Case record immediately during iteration.
- CAdd a Get Records element inside the Loop element to retrieve updated field values before calling an Update Records element.
- DInvoke a Subflow element inside the Loop element that executes an Update Records operation for each individual record.
Answer
Use an Assignment element inside a Loop to populate a Record Collection Variable, and place a single Update Records element outside the Loop.
The correct approach bulkifies database operations by collecting modified record variables into a Record Collection Variable using an Assignment element inside the loop, and executing a single Update Records element after the loop completes. This pattern consumes only one DML statement regardless of how many records are processed.
Step-by-Step Solution
Key Concept
Flow Bulkification and Avoiding DML Elements in Loops