Soru

Zorluk: KolayFlow Resources and Data Manipulation

A System Administrator is creating a record-triggered flow to process changes across related records. Which two practices should the administrator follow when manipulating data and managing resources inside a loop? (Select 2 answers)

  1. Use an Assignment element inside the loop to add modified record variables into a record collection variable.Cevap
  2. B
    Place an Update Records element inside the loop to update each record immediately during every iteration.
  3. C
    Execute a Get Records element inside the loop to retrieve details for each child record individually.
  4. Place an Update Records element outside the loop to process the record collection in a single database operation.Cevap

Cevap

The correct practices are using an Assignment element inside the loop to gather modified record variables into a collection, and placing the Update Records element outside the loop to execute a single bulkified DML operation.
To adhere to Salesforce bulkification standards, administrators must perform variable assignments inside the loop using an Assignment element to populate a collection variable in memory. Once the loop finishes iterating, a single Update Records element placed outside the loop updates all records in the collection in one database transaction.

Adım Adım Çözüm

1
Evaluate resource handling inside Flow loops
Identify that data manipulation (DML) and data retrieval (SOQL) elements must not be placed within loop iterations.
Salesforce enforces strict governor limits on SOQL queries and DML operations per transaction.
2
Identify correct in-loop resource management
Use Assignment elements to update record fields and add the record variables to a Record Collection Variable.
Assignment operations happen entirely in memory and do not count against transaction database governor limits.
3
Identify correct post-loop data manipulation
Place the Update Records element directly after the loop path finishes, passing the record collection variable.
This performs a bulkified DML update, consuming only one DML statement regardless of how many records were processed.

Anahtar Kavram

Flow Bulkification and Resource Management
Bu soruyu puanla