An administrator is designing an autolaunched flow to automatically generate custom Audit Log records for all high-priority Case records closed during the current business day. To adhere to Salesforce governor limits and best practices for bulkification, in what sequence should the flow elements and data manipulation steps be executed?
- 1Query high-priority closed Cases using a Get Records element to store them in a Case record collection variable.
- 2Pass the Case record collection into a Loop element to process each Case record individually.
- 3Execute an Assignment element inside the loop to populate Audit Log field values on a single record variable and add that record variable to a new Audit Log collection variable.
- 4Execute a single Create Records element outside the loop referencing the target Audit Log collection variable.
Answer
The correct order of flow design steps for bulkified record creation is: 1) Query high-priority closed Cases using a Get Records element to populate a Case collection; 2) Pass the Case collection into a Loop element; 3) Execute an Assignment element inside the loop to set field values and add the single record variable to an Audit Log collection; 4) Execute a single Create Records element outside the loop referencing the Audit Log collection.
To design an efficient flow that respects Salesforce governor limits, data must first be retrieved into a record collection using a Get Records element. Next, a Loop element iterates through the collection. Inside the loop path, Assignment elements set field values on a single record variable and append that variable to a target record collection. Finally, after the loop finishes processing all items, a single Create Records element outside the loop commits the accumulated target collection to the database in one DML transaction.
Step-by-Step Solution
Key Concept
Flow Bulkification & Resource Manipulation
Estimated Time:2m 0s