Soru

Zorluk: OrtaFlow Builder Elements and Logic

A company requires that when an Account record is set to 'Inactive', all associated open Service Contract records must automatically have their status updated to 'Canceled'. To ensure the automation processes bulk record updates efficiently without triggering DML governor limits, how should the administrator construct the elements within Flow Builder?

  1. Use a Get Records element to retrieve open contracts, iterate through the collection with a Loop element, update the status in a record variable using an Assignment element, add each record variable to a record collection variable using a second Assignment element, and invoke a single Update Records element after the loop completes.Cevap
  2. B
    Use a Get Records element to retrieve open contracts, iterate through the collection with a Loop element, and place an Update Records element inside the loop to persist changes on each record individually.
  3. C
    Configure the flow as a Fast Field Updates (before-save) record-triggered flow on Account, retrieve the open contracts, and update the related contracts using an Assignment element directly.
  4. D
    Create a Roll-Up Summary field on the Account object that updates the status field on all related child Service Contract records automatically.

Cevap

The flow should retrieve the child records using a Get Records element, loop through them while modifying values and accumulating the items into a record collection using Assignment elements, and then execute a single Update Records element outside the loop.
The correct approach retrieves child records, modifies field values in memory using loop iteration and Assignment elements to build a new record collection variable, and executes a single Update Records DML operation after the loop ends. This pattern ensures the flow is fully bulkified.

Adım Adım Çözüm

1
Query related open Service Contract records
Obtain a collection of child records requiring updates.
Flow needs to know which specific records match the business criteria.
2
Loop through the retrieved collection and use Assignment elements
Update field values on individual record variables and add them to a target record collection variable within the loop iteration.
In-memory variable manipulation does not consume Salesforce governor limits.
3
Execute Update Records element after the loop path completes
Persist all modifications in a single bulkified DML operation.
Placing DML outside the loop ensures the flow stays well within governor limits even when processing large volumes of records.

Anahtar Kavram

Flow Bulkification and Element Design Patterns
Bu soruyu puanla