Activity Forums Salesforce® Discussions What is recursive trigger in salesforce?

  • PRANAV

    Member
    September 27, 2016 at 5:23 am

    Hi Mohit,

    A recursive trigger is one that performs an action, such as an update or insert, which invokes itself owing to,  say something like an update it performs.

    Eg. In a before trigger, if you select some records and update them, the trigger will invoke itself.

    In order to avoid the situation of recursive call, make sure your trigger is getting executed only one time. To do so, you can create a class with a static Boolean variable with default value true.

    In the trigger, before executing your code keep a check that the variable is true or not.

    Once you check, make the variable false.

    Hope this helps you.

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos