A Salesforce Administrator is constructing an autolaunched flow to update a custom status field across a collection of inactive Partner Account records while strictly adhering to Salesforce governor limit best practices. Place the following flow execution steps in the correct order from first step to final step.
- 1Execute a Get Records element outside the loop to retrieve all inactive Partner Account records into a record collection variable.
- 2Pass the retrieved record collection into a Loop element to iterate through each Partner Account record.
- 3Use an Assignment element inside the loop to set the new field values on the current record variable from the loop.
- 4Use a second Assignment element inside the loop to add the updated current record variable to a separate output record collection variable.
- 5Execute an Update Records element outside the loop using the output record collection variable.
Answer
The correct execution order begins with executing a Get Records element to query the inactive Partner Account records into a collection variable, followed by iterating over the collection with a Loop element. Inside the loop, the first Assignment element modifies field values on the current loop item variable, and the second Assignment element adds that modified variable to a new output record collection variable. Finally, after the loop finishes, a single Update Records element executes on the output collection variable.
Salesforce design best practices require bulkifying flows by isolating database transactions (Get Records, Update Records) outside of loops. The process begins by retrieving records into a collection (Get Records), passing that collection into a Loop element, using an Assignment element to update the current record variable's fields, using another Assignment element to append the record variable to an output collection, and finally committing the output collection to the database using an Update Records element after the loop completes.
Step-by-Step Solution
Key Concept
Bulkification and Flow Element Sequence