A Salesforce Administrator needs to design an autolaunched flow that updates the Status field of all active Contact records associated with an Account whenever the Account's Status changes to 'Inactive'. The solution must process multiple child records efficiently without exceeding system governor limits. How should the administrator construct the flow logic?
- Query related active Contacts with a Get Records element, loop through the collection, update each record's Status field in an Assignment element while adding it to a new collection variable, and execute a single Update Records element on the collection after the loop.Cevap
- BQuery related active Contacts with a Get Records element, loop through the collection, and place an Update Records element inside the loop to save changes to each Contact individually.
- CCreate a Roll-Up Summary field on the Account to fetch and update child Contact statuses directly without using collection variables or loop structures.
- DLoop through the child Contacts and use a Decision element to assign picklist values directly without adding the modified records to a record collection variable.
Cevap
Query related active Contacts with a Get Records element, loop through the collection, update each record's Status field in an Assignment element while adding it to a new collection variable, and execute a single Update Records element on the collection after the loop.
The correct approach bulkifies flow operations by gathering updated child records into a record collection variable using Assignment elements inside the loop, followed by a single Update Records element after the loop completes. This pattern ensures that database operations are minimized, adhering to Salesforce governor limits.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification and Collection Processing