Skip to content

Instantly share code, notes, and snippets.

@adtennant
Last active August 29, 2015 14:25
Show Gist options
  • Save adtennant/abc744cc2e6a785e908f to your computer and use it in GitHub Desktop.
Save adtennant/abc744cc2e6a785e908f to your computer and use it in GitHub Desktop.
public class Account {
}
Account anAccount = new Account();
account.Name = 'Test';
public class checkRecursive {
private static boolean run = true;
public static boolean runOnce() {
if(run) {
run = false;
return true;
} else {
return run;
}
}
}
trigger updateTrigger on anyObject(after update) {
if(checkRecursive.runOnce()) {
// write your code here
}
}
trigger updateTrigger on anyObject(after update) {
static Boolean run = true;
if(run) {
run = false;
// write your code here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment