Soru

Zorluk: OrtaFlow Builder Elements and Logic

Universal Containers requires an automated process that updates all open Case records associated with an Account whenever an Opportunity for that Account is set to 'Closed Won'. Which Flow Builder logic pattern should be implemented to update these related records while strictly adhering to governor limit best practices?

  1. Query related Case records before entering a Loop, use an Assignment element inside the loop to modify field values into a record collection variable, and invoke a single Update Records element after the loop finishes.Cevap
  2. B
    Query related Case records before entering a Loop, but execute an Update Records element inside the loop on each iteration to commit changes immediately.
  3. C
    Configure a Fast Field Update (Before-Save) record-triggered flow on the Opportunity object to update the child Case records before the triggering record is saved.
  4. D
    Create a roll-up summary field on the Account object that calculates open Cases and triggers an automatic update to child Case records when the Opportunity stage changes.

Cevap

Query related Case records before entering a Loop, use an Assignment element inside the loop to modify field values into a record collection variable, and invoke a single Update Records element after the loop finishes.
To process multiple records efficiently without exceeding governor limits, data retrieval (Get Records) and data persistence (Update Records) must occur outside of any Loop element. Using an Assignment element inside the loop to stage changes into a record collection variable allows all updates to be executed in a single DML operation after loop execution completes.

Adım Adım Çözüm

1
Identify the automation requirement and scope.
The requirement involves updating related child records (Case) based on changes to a parent/sibling record (Opportunity).
An After-Save record-triggered flow or autolaunched flow is required because related records are being updated.
2
Evaluate Flow Builder logic for bulkification.
SOQL queries (Get Records) and DML statements (Update Records, Create Records, Delete Records) must never reside inside a Loop element.
Iterating over records and executing DML operations within a loop exhausts the maximum limit of 150 DML statements per transaction.
3
Select the correct sequence of Flow elements.
Use Get Records outside the loop → Loop through items → Use Assignment element to populate values into a record collection variable → Use Update Records outside the loop on the record collection variable.
This pattern ensures exactly one DML operation is performed regardless of how many records are processed.

Anahtar Kavram

Flow Bulkification and Governor Limits
Tahmini Süre:1m 30s
Bu soruyu puanla