Skip to main content
added code for inside of trigger
Source Link
crmprogdev
  • 41k
  • 9
  • 58
  • 116

Very astute question! The answer is number 2. You want to put your boolean in your trigger where the class is called from. You'll need a trigger utility class to hold the boolean. This is a large part of why trigger platforms are so useful, particularly ones that have a "trigger main" that acts as a distribution class that follows the logic of a regular base trigger from which your helper classes are called.

Example of Utility class:

Public class TrggrUtility{

   public static boolean RunOnce = False;

}

Test inside of trigger:

If(!TrggrUtility.RunOnce) 
{
   // do... call method
   TrggrUtility.RunOnce = true;

}else{

  // exit trigger or code section

}

Very astute question! The answer is number 2. You want to put your boolean in your trigger where the class is called from. You'll need a trigger utility class to hold the boolean. This is a large part of why trigger platforms are so useful, particularly ones that have a "trigger main" that acts as a distribution class that follows the logic of a regular base trigger from which your helper classes are called.

Example of Utility class:

Public class TrggrUtility{

   public static boolean RunOnce = False;

}

Very astute question! The answer is number 2. You want to put your boolean in your trigger where the class is called from. You'll need a trigger utility class to hold the boolean. This is a large part of why trigger platforms are so useful, particularly ones that have a "trigger main" that acts as a distribution class that follows the logic of a regular base trigger from which your helper classes are called.

Example of Utility class:

Public class TrggrUtility{

   public static boolean RunOnce = False;

}

Test inside of trigger:

If(!TrggrUtility.RunOnce) 
{
   // do... call method
   TrggrUtility.RunOnce = true;

}else{

  // exit trigger or code section

}
Source Link
crmprogdev
  • 41k
  • 9
  • 58
  • 116

Very astute question! The answer is number 2. You want to put your boolean in your trigger where the class is called from. You'll need a trigger utility class to hold the boolean. This is a large part of why trigger platforms are so useful, particularly ones that have a "trigger main" that acts as a distribution class that follows the logic of a regular base trigger from which your helper classes are called.

Example of Utility class:

Public class TrggrUtility{

   public static boolean RunOnce = False;

}