Skip to content

Instantly share code, notes, and snippets.

@mailtoharshit
Created November 1, 2012 23:41
Show Gist options
  • Save mailtoharshit/3997579 to your computer and use it in GitHub Desktop.
Save mailtoharshit/3997579 to your computer and use it in GitHub Desktop.
ControlledTriggerHelper
//TODO: This class will stop allowing trigger to fire-in twice
public class ControlledTriggerHelper {
// initialize a variable to hold state
private static boolean alreadyModified = false;
// get the state
public static boolean isAlreadyModified() {
return alreadyModified;
}
// set this to true to keep track of and avoid recursive updates.
// Generally set after first time through
// a trigger. We can access this in the trigger and avoid recursive updates.
public static void setAlreadyModified() {
alreadyModified = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment