Returns true if the current context for the Apex code is a trigger, not a Visualforce page, a Web service, or an executeanonymous()API call.
It just tells you whether you are right now in the middle of executing a trigger.
In other words, if a web service inserts a record in the database, the insert trigger can't tell whether web service caused the trigger to execute or was it done from UI.
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
"isExecuting" is another keyword to seggregate a piece of code while a transaction is going on which is initiated by a trigger.
When do we use it ?
Lets say we have a Utility class that does some job based on the params. This class is used by visualforce pages as well as a trigger.
Example Scenario :
Utility Class will look like
So when you call it from a trigger and visualforce it will behave differently based on the isExecuting.
All Answers
isExecuting -
Returns true if the current context for the Apex code is a trigger, not a Visualforce page, a Web service, or an executeanonymous() API call.
It just tells you whether you are right
now in the middle of executing a trigger.
In other words, if a web service inserts a record in the database, the insert trigger can't tell whether web service caused the trigger to execute or was it
done from UI.
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
HI
isExecuting context variable used for checking if the current context for the Apex code is a trigger or not ?
I am sharing some code you can refer
If this post helps you give kudos and mark it as solutions If it solves your question
Thanks
"isExecuting" is another keyword to seggregate a piece of code while a transaction is going on which is initiated by a trigger.
When do we use it ?
Lets say we have a Utility class that does some job based on the params. This class is used by visualforce pages as well as a trigger.
Example Scenario :
Utility Class will look like
So when you call it from a trigger and visualforce it will behave differently based on the isExecuting.