How to find whether apex is currently executed in Trigger Context in Salesforce?

How to find whether apex is currently executed in Trigger Context in Salesforce?

Trigger.isExecuting can be used to find whether apex is currently executed in Trigger Context in Salesforce.

Sample Code:

System.debug( 
    'Is it in trigger context ' + Trigger.isExecuting 
);

Output:

Leave a Reply