Skip to content

IF_Trigger

Class · Group: Triggers

apex
global inherited sharing class IF_Trigger

Contracts for metadata-driven trigger action handlers. Each nested interface corresponds to a Salesforce trigger event and defines the callback signature that handler classes must implement. Handlers extend TRG_Base and declare the interfaces matching the events they handle; the TRG_Dispatcher invokes the correct callback at runtime based on TriggerAction__mdt configuration. Adapted from: apex-trigger-actions-framework

Since: 1.0

Example:

apex
public class TRG_SetDefaults extends TRG_Base implements IF_Trigger.BeforeInsert
{
    public void beforeInsert(List<SObject> newRecords)
    {
        for(SObject record : newRecords)
        {
            record.put('Status__c', 'New');
        }
    }
}

See Also: TRG_Base


Properties

PropertyDescription
global interface AfterDeleteHandler contract for the after-delete trigger event.
global interface AfterInsertHandler contract for the after-insert trigger event.
global interface AfterUndeleteHandler contract for the after-undelete trigger event.
global interface AfterUpdateHandler contract for the after-update trigger event.
global interface BeforeDeleteHandler contract for the before-delete trigger event.
global interface BeforeInsertHandler contract for the before-insert trigger event.
global interface BeforeUpdateHandler contract for the before-update trigger event.
global interface PostActionHandler contract for a post-trigger action — an Apex class that runs exactly once at the end of a trigger transaction, after every trigger action on every touched SObject has completed.
global interface PostActionEntryCriteriaOptional entry-criteria contract for a post-trigger action.

Inner Classes

ClassDescription
PostActionContextContext handed to a post-trigger action when the dispatcher unwinds the outermost trigger dispatch.