Avoid invocation of future methods inside loops

< 1 min read

Impact area

Performance

Severity

High

Affected element

Apex Class

Rule ID #

SF-AVOID-FUTURE-IN-LOOP

Impact #

Invoke a future method inside a loop can raise a governor limit exception.

Remediation #

Build up a collection of all requests that need to be made and pass it off in a single call to the future method.

Time to fix  #

45 min

Updated on March 21, 2025
Was it helpful ?