A Salesforce Administrator is building an After-Save Record-Triggered Flow on the Asset object. When an Asset's Status field is changed to 'Obsolete', all open child Cases associated with that Asset must have their Status updated to 'Closed - Asset Replaced'. Which element configuration best achieves this requirement while adhering to Salesforce governor limits and bulkification best practices?
- Execute a Get Records element to collect open Cases, loop through the collection, use an Assignment element inside the loop to set the new Status on the loop variable and add it to a new collection variable, then execute a single Update Records element after the loop.Cevap
- BExecute a Get Records element to collect open Cases, loop through the collection, and place an Update Records element inside the loop to commit field changes on each Case record individually.
- CCreate a Roll-Up Summary field on the Asset object to aggregate child Cases, and use a Before-Save Record-Triggered Flow to automatically update the child Case records directly.
- DUse a Decision element inside a loop to update the Case Record Type picklist assignment directly, avoiding the need for Get Records or Update Records elements.
Cevap
The recommended solution is to execute a Get Records element to retrieve open child Cases into a collection, iterate through them using a Loop element while updating values in a secondary collection via Assignment elements, and execute a single Update Records element outside the loop.
The option advocating a Get Records element followed by a Loop with Assignment elements and a single Update Records element outside the loop correctly implements Salesforce flow bulkification design patterns. By accumulating modified record variables in a new collection variable during iteration and executing DML outside the loop, the flow uses only one DML statement regardless of how many child Cases are updated.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification and Element Logic
Tahmini Süre:1m 30s