Skip to main content
fix typo
Source Link
Adam Spriggs
  • 31.5k
  • 6
  • 45
  • 90

The [roblemproblem is that your variables are static. Remove the keyword static and they'll become instance variables and will only apply within the context of each instance of the trigger.

I don't know exactly what pattern you're using, but if all you're doing is calling a single class, use something more like the following:

global class TriggerHelper {

public Boolean isDel= false;
public Boolean isExec = false;
public Boolean isUpdte = false;
public Boolean isInsrt = false;
public Boolean inPrcss = false;
public Boolean isAftr = false;
public boolean isReEntryInsrt = false;
public boolean IsReEntryUpdte = false;

}

Remember that when you do the check if(!TriggerHelper.isReEnterInsrt) all you're doing is testing to see whether or not it's been initialized in your class. You don't need to change it's value. Instead, all you need do is declare a new instance of it by calling TriggerHelper.isReInsert isReInsert = new TriggerHelper.isReEnterInsrt;

The [roblem is that your variables are static. Remove the keyword static and they'll become instance variables and will only apply within the context of each instance of the trigger.

I don't know exactly what pattern you're using, but if all you're doing is calling a single class, use something more like the following:

global class TriggerHelper {

public Boolean isDel= false;
public Boolean isExec = false;
public Boolean isUpdte = false;
public Boolean isInsrt = false;
public Boolean inPrcss = false;
public Boolean isAftr = false;
public boolean isReEntryInsrt = false;
public boolean IsReEntryUpdte = false;

}

Remember that when you do the check if(!TriggerHelper.isReEnterInsrt) all you're doing is testing to see whether or not it's been initialized in your class. You don't need to change it's value. Instead, all you need do is declare a new instance of it by calling TriggerHelper.isReInsert isReInsert = new TriggerHelper.isReEnterInsrt;

The problem is that your variables are static. Remove the keyword static and they'll become instance variables and will only apply within the context of each instance of the trigger.

I don't know exactly what pattern you're using, but if all you're doing is calling a single class, use something more like the following:

global class TriggerHelper {

public Boolean isDel= false;
public Boolean isExec = false;
public Boolean isUpdte = false;
public Boolean isInsrt = false;
public Boolean inPrcss = false;
public Boolean isAftr = false;
public boolean isReEntryInsrt = false;
public boolean IsReEntryUpdte = false;

}

Remember that when you do the check if(!TriggerHelper.isReEnterInsrt) all you're doing is testing to see whether or not it's been initialized in your class. You don't need to change it's value. Instead, all you need do is declare a new instance of it by calling TriggerHelper.isReInsert isReInsert = new TriggerHelper.isReEnterInsrt;

Source Link
crmprogdev
  • 41.2k
  • 9
  • 61
  • 116

The [roblem is that your variables are static. Remove the keyword static and they'll become instance variables and will only apply within the context of each instance of the trigger.

I don't know exactly what pattern you're using, but if all you're doing is calling a single class, use something more like the following:

global class TriggerHelper {

public Boolean isDel= false;
public Boolean isExec = false;
public Boolean isUpdte = false;
public Boolean isInsrt = false;
public Boolean inPrcss = false;
public Boolean isAftr = false;
public boolean isReEntryInsrt = false;
public boolean IsReEntryUpdte = false;

}

Remember that when you do the check if(!TriggerHelper.isReEnterInsrt) all you're doing is testing to see whether or not it's been initialized in your class. You don't need to change it's value. Instead, all you need do is declare a new instance of it by calling TriggerHelper.isReInsert isReInsert = new TriggerHelper.isReEnterInsrt;