An administrator is designing an after-save record-triggered flow on the Account object to update all related open Work Orders when an Account is marked as inactive. To ensure optimal performance and avoid reaching SOQL and DML governor limits, which two design practices should the administrator follow? (Select 2 answers.)
- Execute a single Get Records element outside of any loop to retrieve all open Work Orders into a record collection variable.Answer
- BPlace an Update Records element inside the Loop element to immediately save changes for each individual Work Order.
- Use an Assignment element within the loop to update record values in a collection, then execute a single Update Records element after the loop completes.Answer
- DCreate a Roll-Up Summary field on the Account object to perform the field updates on child records over a lookup relationship.
Answer
The administrator should execute a single Get Records element outside of any loop to retrieve open Work Orders into a collection variable, and use an Assignment element inside the loop to accumulate changes in a collection before calling a single Update Records element after the loop.
To design bulkified flows that respect Salesforce governor limits, data retrieval (Get Records) and data manipulation (Update Records) elements must be placed outside of loops. The flow should fetch all target records in a single SOQL query, iterate over the collection to assign new field values in memory, and update the modified collection using a single DML operation after the loop completes.
Step-by-Step Solution
Key Concept
Bulkification in Flow Builder