Activity Forums Salesforce® Discussions How can we prevent from the recursive trigger in Salesforce?

  • Deepak

    Member
    July 6, 2020 at 9:36 am

    Recursive triggers can be prevented when 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.

  • Ayush

    Member
    July 6, 2020 at 1:29 pm
  • Marziya

    Member
    July 6, 2020 at 1:32 pm

    To avoid recursive triggers 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.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos