TriggerHandler Virtual Class
Source https://github.com/kevinohara80/sfdc-trigger-framework
Group Trigger
public TriggerHandler()
Constructor to instantiate a trigger handler
public void run()
This method is the main ‘execution’ of a trigger. It is responsible for classing the various methods throughout the lifecycle of a trigger.
public void setMaxLoopCount(Integer max)
Configure a maximum ‘recursion’ for a trigger
Param | Description |
---|---|
max |
The maximum number of recursions allowed |
MyTriggerHandler.setMaxLoopCount(1);
public void clearMaxLoopCount()
Remove the maximum ‘recursion’ for a trigger
MyTriggerHandler.clearMaxLoopCount();
public static void bypass(String handlerName)
Add a specific handler to the bypass list
Param | Description |
---|---|
handlerName |
MyTriggerHandler.bypass('myHandlerName');
public static void clearBypass(String handlerName)
Remove a specific handler from the bypass list
Param | Description |
---|---|
handlerName |
MyTriggerHandler.clearBypass('myHandlerName');
public static Boolean isBypassed(String handlerName)
Helper to check if a specific handler is in the bypass list
Param | Description |
---|---|
handlerName |
Type | Description |
---|---|
Boolean |
Boolean |
MyTriggerHandler.isBypassed('myHandlerName');
public static void clearAllBypasses()
Empties all handlers from the bypass list
MyTriggerHandler.clearAllBypasses();
Custom exception for TriggerHandler-specific exceptions
Inheritance
TriggerHandlerException