You need to sign in to do that
Don't have an account?
TCAdmin
Please confirm understanding
Hello,
I am doing two things to an Opportunity before saving. I have it currently setup as two triggers but I think that this is probably not the best method. Is it normally best to build only one trigger per object that is triggered on a specific event? One trigger for before update, one for before insert, or one for both before update and before insert?
The reason I'm asking is because I am having issues with order of execution. I will probably need to combine the triggers so that they process only as I want and take out any random issues.
I am doing two things to an Opportunity before saving. I have it currently setup as two triggers but I think that this is probably not the best method. Is it normally best to build only one trigger per object that is triggered on a specific event? One trigger for before update, one for before insert, or one for both before update and before insert?
The reason I'm asking is because I am having issues with order of execution. I will probably need to combine the triggers so that they process only as I want and take out any random issues.
It is Best to have one trigger per object and use the Trigger.isBefore and Trigger.isAfter to "order" the execution of the trigger.
There is also Trigger.isUpdate and Trigger.isInsert etc...
Check page, 60 of the summer apex guide for the Trigger Context Variables.