Skip to content

IF_Trigger.PostActionEntryCriteria

Class

apex
global interface IF_Trigger.PostActionEntryCriteria

Optional entry-criteria contract for a post-trigger action. Implementing classes are referenced from PostTriggerAction__mdt.EntryCriteriaContextClassName__c and consulted before the post-action's execute(context) is invoked. Returning false skips the row; returning true proceeds to execution. Use for context-level gating (e.g. "only run when Account records were touched AND feature flag X is enabled"). Evaluators should be cheap — configuration lookups, feature-flag checks, Set membership tests, at most one bounded SOQL. Expensive evaluators undermine the cost benefit of having an entry criteria at all.

Since: 1.1


Methods

MethodDescription
global abstract Boolean shouldRun(IF_Trigger.PostActionContext context)Called once per outermost dispatch before the gated post-action.

Method Details

shouldRun

apex
global abstract Boolean shouldRun(IF_Trigger.PostActionContext context)

Called once per outermost dispatch before the gated post-action. Returning false skips the post-action; returning true proceeds to execution.

Parameters:

  • context (IF_Trigger.PostActionContext) - The post-action context for this dispatch. Carries the set of SObject types whose triggers participated in the transaction.

Returns: Boolean - true if the gated post-action should run; false to skip it.

Since: 1.1

Example:

apex
public class TRG_PostActionEntryBrandA implements IF_Trigger.PostActionEntryCriteria
{
    public Boolean shouldRun(IF_Trigger.PostActionContext context)
    {
        if(!context.touchedSObjectTypes.contains(Account.SObjectType)) return false;
        return UTIL_FeatureFlag.isEnabled('BrandA_Sales_Enabled');
    }
}