An administrator is designing a record-triggered flow to archive all Campaign Member records when a parent Campaign is marked as 'Completed'. To ensure optimal performance and prevent hitting governor limits, the flow must properly manipulate memory resources and bulkify record updates.
In which order should the administrator sequence the Flow elements and data manipulation steps to achieve this requirement?
- 1Retrieve related Campaign Member records into a collection using a Get Records element.
- 2Iterate through each Campaign Member in the collection using a Loop element.
- 3Set the Status field value on the current loop record variable using an Assignment element.
- 4Add the updated current loop record variable to a new record collection variable using an Assignment element.
- 5Perform a single DML update on the staged record collection variable using an Update Records element after the loop finishes.
Cevap
The correct sequence is: (1) Retrieve related Campaign Member records into a collection using a Get Records element, (2) Iterate through each Campaign Member in the collection using a Loop element, (3) Set the Status field value on the current loop record variable using an Assignment element, (4) Add the updated current loop record variable to a new record collection variable using an Assignment element, and (5) Perform a single DML update on the staged record collection variable using an Update Records element after the loop finishes.
The standard, bulkified Salesforce Flow design pattern dictates that records are first retrieved into a collection (Get Records), iterated individually (Loop), updated in memory (Assignment on current item), accumulated into a secondary collection (Assignment with Add operator), and finally updated in the database as a single transaction after the loop terminates (Update Records).
Adım Adım Çözüm
Anahtar Kavram
Flow bulkification design pattern utilizing Assignment elements to stage modified record variables into a collection for a single DML operation outside a Loop.
Tahmini Süre:1m 15s