Trigger. isExecuting is to determine that your current context for the Apex code is a trigger, not a Visualforce page, a Web service, or an executeanonymous() API call. Here is an example of Apex Class, this class can identify current context for the Apex code is a trigger using Trigger