Skip to main content

Apex classes

This page provides information about the globally exposed Apex classes in Komodo Publications Planning that you can reference and use.

The Dynamic Trigger Handler (TAF_DynamicTriggerHdlr) Apex class exposes the methods for configuring the Trigger Action Framework (TAF).

global inherited sharing class TAF_DynamicTriggerHdlr

Constructor

TAF_DynamicTriggerHdlr()

global TAF_DynamicTriggerHdlr()

Description

An empty constructor that allows the run(key) method to be called.

Method(s)

addMetadataTriggerHandlerBypass(triggerActionName)

global static void addMetadataTriggerHandlerBypass(String triggerActionName)

Description

This method bypasses a specific trigger action during a transaction.

Returns

void

Parameter

Type

Description

triggerActionName

String

The API name of the Trigger Action (mvn__TAF_Trigger_Action__mdt) metadata record to bypass.

addTriggerActionFlowBypass(flowName)

global static void addTriggerActionFlowBypass(String flowName)

Description

This method bypasses a specific flow during a transaction.

Returns

void

Parameter

Type

Description

flowName

String

The API name of the flow to bypass.

addTriggerBaseBypass(sObjectName)

global static void addTriggerBaseBypass(String sObjectName)

Description

This method bypasses the trigger execution of a given sObject.

Returns

void

Parameter

Type

Description

sObjectName

String

The API name of the sObject to bypass the trigger on.

clearMetadataTriggerHandlerBypass(triggerActionName)

global static void clearMetadataTriggerHandlerBypass(String triggerActionName)

Description

This method clears the bypass flag for a specific trigger action.

Returns

void

Parameter

Type

Description

triggerActionName

String

The API name of the Trigger Action (mvn__TAF_Trigger_Action__mdt) metadata record to no longer bypass and to execute instead.

clearTriggerActionFlowBypass(flowName)

global static void clearTriggerActionFlowBypass(String flowName)

Description

This method clears the bypass flag for a specific flow.

Returns

void

Parameter

Type

Description

flowName

String

The API name of the flow to no longer bypass and to execute instead.

clearTriggerBaseBypass(sObjectName)

global static void clearTriggerBaseBypass(String sObjectName)

Description

This method clears the bypass flag for a given sObject.

Returns

void

Parameter

Type

Description

sObjectName

String

The API name of the sObject to no longer bypass and to execute the trigger on instead.

getIdToNumberOfTimesSeenAfterUpdate()

global static Map<Id, Integer> getIdToNumberOfTimesSeenAfterUpdate()

Description

This method returns a map of the context record IDs to the number of times they've been operated on in the AFTER UPDATE context. You can use this method to check the number of times the trigger has processed the records and therefore if the trigger is running recursively but cannot use this method to stop a recursion.

Returns

Map<Id, Integer>

getIdToNumberOfTimesSeenBeforeUpdate()

global static Map<Id, Integer> getIdToNumberOfTimesSeenBeforeUpdate()

Description

This method returns a map of the context record IDs to the number of times they've been operated on in the BEFORE UPDATE context. You can use this method to check the number of times the trigger has processed the records and therefore if the trigger is running recursively but cannot use this method to stop a recursion.

Returns

Map<Id, Integer>

run(key)

global void run(String key)

Description

This method is called from the trigger and initiates a new run.

Returns

void

Parameter

Type

Description

key

String

The name of the trigger handler.