Foundations Apex API Developer Reference

fferpcore.PluggableTrigger

global inherited sharing class PluggableTrigger extends fflib_SObjectDomain

A domain class for an Apex trigger which executes any pluggable triggers (classes implementing PluggableTriggerApi.Plugin). It is intended to be used with fflib_SObjectDomain from FFLib, which invokes the methods on this class.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

trigger BillingDocumentTrigger on BillingDocument__c(
    before insert,
    before update,
    before delete,
    after insert,
    after update,
    after delete,
    after undelete
) {
    fflib_SObjectDomain.triggerHandler(fferpcore.PluggableTrigger.class);
}

Methods

PluggableTrigger

global PluggableTrigger(List<SObject> sObjectList, List<fferpcore.PluggableTriggerApi.Plugin> plugins)

Construct this domain class.

Input Parameters

Name Type Description
sObjectList List<SObject> The SObject records from the Apex Trigger.
plugins List<fferpcore.PluggableTriggerApi.Plugin> The pluggable triggers to apply the SObject records.

onBeforeInsert

global override void onBeforeInsert()

Invokes onBeforeInsert() on each pluggable trigger.

onBeforeUpdate

global override void onBeforeUpdate(Map<Id, SObject> existingRecords)

Invokes onBeforeUpdate() on each pluggable trigger.

Input Parameters

Name Type Description
existingRecords Map<Id, SObject> The records as they were before the current update.

onBeforeDelete

global override void onBeforeDelete()

Invokes onBeforeDelete() on each pluggable trigger.

onAfterInsert

global override void onAfterInsert()

Invokes onAfterInsert() on each pluggable trigger.

onAfterUpdate

global override void onAfterUpdate(Map<Id, SObject> existingRecords)

Invokes onAfterUpdate() on each pluggable trigger.

Input Parameters

Name Type Description
existingRecords Map<Id, SObject> The records in their final state, allowing validation.

onAfterDelete

global override void onAfterDelete()

Invokes onAfterDelete() on each pluggable trigger.

onAfterUndelete

global override void onAfterUndelete()

Invokes onAfterUndelete() on each pluggable trigger.

fferpcore.PluggableTrigger.Constructor

global inherited sharing class Constructor implements fflib_SObjectDomain.IConstructable

Responsible for finding and constructing any pluggable triggers.

Methods

Constructor

global Constructor()

construct

global fferpcore.PluggableTrigger construct(List<SObject> objects)

Constructs the pluggable triggers.

© Copyright 2009–2023 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.