You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is true after inspecting your trigger pattern. Looking for verification and suggesting you add to your documentation.
If doing a bulk DML operation such as Database.insert(sobjList,false), per the Apex documentation, if some records fail, Apex will attempt a second and possibly third retry on the failing sobjects.
You would not want the trigger recursion static variables to be remembered for the second or third retry as otherwise the retry logic will not execute one's trigger handler business logic.
I believe your pattern addresses this because on a retry, per the doc, the trigger refires which means the xxxObjectTriggerHandler will be reinstantiated for the retry set and thus reset the isXXXXFirstRun booleans.
The text was updated successfully, but these errors were encountered:
I think this is true after inspecting your trigger pattern. Looking for verification and suggesting you add to your documentation.
If doing a bulk DML operation such as
Database.insert(sobjList,false)
, per the Apex documentation, if some records fail, Apex will attempt a second and possibly third retry on the failing sobjects.You would not want the trigger recursion static variables to be remembered for the second or third retry as otherwise the retry logic will not execute one's trigger handler business logic.
I believe your pattern addresses this because on a retry, per the doc, the trigger refires which means the
xxxObjectTriggerHandler
will be reinstantiated for the retry set and thus reset theisXXXXFirstRun
booleans.The text was updated successfully, but these errors were encountered: