You need to sign in to do that
Don't have an account?
JN22
Test Class to Cover Single Trigger
Hello,
I have a test class that currently covers multiple triggers. How can I get this calss to cover only 1 trigger? It's causing an issue because some of the triggers are Before Insert triggers and others are After Insert so I am getting Null Pointer Exception errors because of it. Thanks,
I have a test class that currently covers multiple triggers. How can I get this calss to cover only 1 trigger? It's causing an issue because some of the triggers are Before Insert triggers and others are After Insert so I am getting Null Pointer Exception errors because of it. Thanks,
public class triggerControl{
public static stopExecution;
}
in your class set the
triggerControl.stopExecution = true;
in your triggers which dont need execution check if triggerControl.stopExecution = false and execute code,
in the trigger you need executing check for triggerControl.stopExecution = true and execute code..
Hope this helps
Ta
Vish
All Answers
This should solve your issue.
Vishant
Thanks for the reply. So I need to add code to each trigger that sets the boolean value and checks that class? Then I need to do this for every other trigger as well to cover individually? Thanks,
public class triggerControl{
public static stopExecution;
}
in your class set the
triggerControl.stopExecution = true;
in your triggers which dont need execution check if triggerControl.stopExecution = false and execute code,
in the trigger you need executing check for triggerControl.stopExecution = true and execute code..
Hope this helps
Ta
Vish
Ta
Vish