An administrator is designing a Screen Flow that allows customer support agents to generate follow-up Task records for multiple Contacts linked to an escalated Case. The flow must process all selected Contacts and create the corresponding Tasks efficiently without hitting governor limits. Which design pattern should the administrator implement using Flow resources and data elements?
- APlace a Create Records element directly inside the Loop element to immediately insert each Task record as each Contact is processed.
- BConfigure an after-save Record-Triggered Flow with an Update Records element on the parent Case to automatically invoke the creation of individual Tasks.
- Populate a Task record variable within a Loop element, add it to a Task record collection variable using an Assignment element, and execute a single Create Records element after the Loop.Answer
- DRely on custom validation rules configured to fire after the Create Records element inside the Loop to roll back transactions whenever volume exceeds limits.
Answer
Populate a Task record variable within a Loop element, add it to a Task record collection variable using an Assignment element, and execute a single Create Records element after the Loop.
Salesforce best practices dictate that Flows must be bulkified. By utilizing an Assignment element inside the loop to add each individual record variable to a record collection variable, the database insert can be deferred until the loop finishes. A single Create Records element pointing to the collection variable consumes only one DML statement regardless of the number of items.
Step-by-Step Solution
Key Concept
Flow Bulkification and Collection Manipulation
Estimated Time:1m 15s