Wednesday, 1 July 2015

How to prevent recursive triggers

CLASS
public class staticFun {
public static boolean runME = true;
}

TRIGGER
trigger t1 on Account (before Insert, before update) {
if(staticFun.runME==true){
//do logic here
staticFun.runME = false;
}

  }

No comments:

Post a Comment