mitchspano/trigger-actions-framework

Bypass Trigger Action in code - by Class Name or by Action Name?

Closed this issue · 2 comments

Hi,

It’s not clear which name I should use for the Trigger Action Bypass: the class name, as shown in the example, or the action name, as mentioned in the source code.

In some cases, I use the same class for multiple trigger actions (for example, before update and before insert). If I should use the class name for the bypass, will it bypass both trigger actions?

Thx,
Alex

The API name of the metadata row is unused throughout the application - we don't drive any logic from it.

  • TriggerBase.bypass(String sObjectName)
  • MetadataTriggerHandler.bypass(String className)
  • TriggerActionFlow.bypass(String flowApiName)

If you call MetadataTriggerHandler.bypass, it accepts the class name and it will bypass for all context interfaces that the class implements for the remainder of the transaction.

Thanks, Mitch, and congratulations on your new position! 😉