Question

Difficulty: HardFlow Builder Elements and Logic

A financial services company requires an automated process on the Account object to update the Priority field to 'Critical' on all open child Case records whenever an Account is marked as 'High Risk'. Because an Account may have hundreds of associated open Cases, the solution must strictly adhere to Salesforce governor limits. Which Flow Builder design strategy should the administrator implement to accomplish this requirement efficiently?

  1. Use a Get Records element to retrieve all related open Cases into a collection, iterate through the collection with a Loop element, modify field values using an Assignment element to accumulate updated records into a target collection, and invoke a single Update Records element after the loop finishes.Answer
  2. B
    Use a Get Records element to fetch related open Cases, iterate through them using a Loop element, and place an Update Records element directly inside the loop path to modify each Case record individually on each iteration.
  3. C
    Create a Roll-Up Summary field on the Account object linked via a lookup relationship to iterate through child Cases, and use a Decision element to automatically update Case priorities.
  4. D
    Use an Assignment element to update the Priority field directly on the Account record type picklist assignment, relying on automated record type cascading to push changes to all child Cases.

Answer

Use a Get Records element to retrieve all related open Cases into a collection, iterate through the collection using a Loop element, update record values within an Assignment element that adds modified records to a second collection variable, and perform a single Update Records element outside the loop.
The correct approach bulkifies the flow by performing data manipulation in memory using Assignment elements and executing only a single Update Records operation after the Loop finishes. This design scales safely for large numbers of related records without exceeding transaction governor limits.

Step-by-Step Solution

1
Retrieve related child records into a collection variable
A single Get Records element fetches all open Case records linked to the triggering Account ID without executing queries inside a loop.
Bulkifying data retrieval conserves SOQL query governor limits.
2
Iterate over the record collection and modify field values in memory
A Loop element evaluates each loop item, and an Assignment element updates the Priority field on the current loop item before adding it to a new output collection variable.
In-memory variable assignment does not consume database DML operations.
3
Commit all updated records in a single DML operation after loop completion
An Update Records element targets the output collection variable along the 'After Last' path of the Loop element.
Executing DML outside the loop ensures only one DML transaction statement is consumed regardless of how many child records are modified.

Key Concept

Flow Bulkification and Governor Limits
Estimated Time:2m 0s
Rate this question