Executing DML actions like Create, Update, or Delete Records inside a loop should be avoided due to governor limits (e.g., DML limit of 150 per transaction). Instead, store records in a collection and perform bulk operations after the loop.
B. Correct — Executing DML inside loops risks hitting limits and should be avoided.
Incorrect Options:
A. Assigning values is acceptable and common in loops.
C. Screen elements are not used inside loops — but displaying data is not an execution problem itself.
D. While nesting loops is discouraged for performance, the greater risk comes from DML actions inside loops.
Reference Extracts from Salesforce Process Automation Study Guide:
“Avoid performing DML operations inside a loop. Instead, collect records and update them outside the loop.”
“Bulkification of actions is a Flow best practice to prevent hitting governor limits.”
Submit