You need to sign in to do that
Don't have an account?
Make a trigger run only once
A trigger can be fired twice, if there is a workflow too on the same object updating the field.
Is there a way, we can restrict the trigger to fire only once?
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
A trigger can be fired twice, if there is a workflow too on the same object updating the field.
Is there a way, we can restrict the trigger to fire only once?
if you want to block recursing you can declare a static variable in a Apex class and check the value of the variable before doing any dml.
public class Recursion blocker{
public static Boolean flag = true;
}
trigger updateaccountstatus on Opportunity (after update){
if(RecursionBlock.Flag = true){
RecursionBlock.Flag = false;
//do your operation here
}
}