A Salesforce Administrator is configuring a scheduled flow to process thousands of closed Case records nightly. For each processed record, the flow must update a summary field on the parent Account and create a custom Case_Audit__c record to store historical tracking details. Which two flow design choices ensure the flow processes records efficiently without exceeding governor limits?
- Populate individual Case_Audit__c record variables within the loop, add them to a record collection variable using an Assignment element, and execute a single Create Records element outside the loop.Cevap
- BPlace a Create Records element inside the loop immediately after assigning values to the Case_Audit__c record variable to commit each audit log in real time.
- Update Account record variable values inside the loop, append each modified Account record to an Account collection variable using an Assignment element, and execute a single Update Records element after the loop finishes.Cevap
- DAdd a Get Records element inside the loop prior to updating each parent Account record to ensure the flow works with the latest database values.
Cevap
The administrator should use Assignment elements inside the loop to append individual record variables to collection variables, followed by executing single Create Records and Update Records data elements outside the loop.
To follow Salesforce bulkification practices when manipulating data in flows, all data operations (SOQL queries and DML updates/creates) must occur outside of loop iterations. The correct choices collect modified and newly created record variables into collection resources via Assignment elements inside the loop, then execute bulk Create Records and Update Records operations outside the loop using those collection variables.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification and Data Manipulation outside Loops