function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Meenakshi sinhaMeenakshi sinha 

Trigger.IsExecuting

Hello
Pls let me know what is Trigger.IsExecuting and in what business scenarios can we use it.

Thanks
meenakshi​​​
Best Answer chosen by Meenakshi sinha
Arunkumar RArunkumar R

All Answers

sandeep@Salesforcesandeep@Salesforce
Hi, 
It is just to determine that your code is executing is called by Trigger or VF page. 
When decoupling the Apex trigger handler class from the actual trigger, the Apex class has no way to know what context it's called in (unit test, web service, visualforce page, trigger). This flag just means the handler was executed by a trigger.
 
public class contextDetermination
{
  public Boolean dummyMethod()
  {
     System.debug('  your current context is ' + Trigger.isExecuting);

  }
}

Thanks 
Sandeep Singhal
http://www.codespokes.com/
Arunkumar RArunkumar R
This was selected as the best answer