Soru

Zorluk: OrtaFlow Builder Elements and Logic

A Salesforce Administrator is designing a record-triggered flow on a custom Contract object that executes when a Contract status updates to Activated. The flow must process all associated child Contract Line Item records linked via a custom lookup relationship, calculate total values, and update fields on both the line items and the parent Contract record while strictly avoiding governor limit violations. Which two design choices should the administrator implement within Flow Builder?

  1. Use an Assignment element inside the loop to aggregate values into variables and add modified line items to a record collection variable.Cevap
  2. B
    Place a Get Records element inside the loop to dynamically fetch full field details for each child Contract Line Item record during each iteration.
  3. Position the Update Records element after the loop execution path to update the record collection in a single transaction.Cevap
  4. D
    Create a Roll-Up Summary field on the parent Contract object to calculate the total amount across the lookup relationship without using flow logic.

Cevap

The administrator should use an Assignment element inside the loop to accumulate totals and build a record collection in memory, and position the Update Records element after the loop path to perform a single bulkified DML operation.
To process multiple child records without reaching governor limits, calculations and record updates must be handled in memory within the loop using Assignment elements. The actual database update is bulkified by placing a single Update Records element outside the loop to process the accumulated collection.

Adım Adım Çözüm

1
Evaluate relationship type and aggregation capabilities
Identified that Roll-Up Summary fields cannot be created on lookup relationships, necessitating automated Flow logic for calculations.
Roll-Up Summary fields strictly require a Master-Detail relationship on standard declarative configurations.
2
Configure loop iteration and in-memory variable assignment
Used Assignment elements within the loop path to calculate total amounts and append updated records into a collection variable.
Assignment elements execute in memory without consuming SOQL or DML transaction limits.
3
Bulkify database interactions
Placed the Update Records element along the 'After Last Item' path of the loop, targeting the record collection variable.
Executing data operations outside the loop ensures all record updates occur within a single DML statement.

Anahtar Kavram

Flow Builder Bulkification and Element Placement Rules
Bu soruyu puanla