IF_Trigger
Class · Group: Triggers
apex
global inherited sharing class IF_TriggerContracts 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
| Property | Description |
|---|---|
| global interface AfterDelete | Handler contract for the after-delete trigger event. |
| global interface AfterInsert | Handler contract for the after-insert trigger event. |
| global interface AfterUndelete | Handler contract for the after-undelete trigger event. |
| global interface AfterUpdate | Handler contract for the after-update trigger event. |
| global interface BeforeDelete | Handler contract for the before-delete trigger event. |
| global interface BeforeInsert | Handler contract for the before-insert trigger event. |
| global interface BeforeUpdate | Handler contract for the before-update trigger event. |
| global interface PostAction | Handler 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 PostActionEntryCriteria | Optional entry-criteria contract for a post-trigger action. |
Inner Classes
| Class | Description |
|---|---|
| PostActionContext | Context handed to a post-trigger action when the dispatcher unwinds the outermost trigger dispatch. |