You need to sign in to do that
Don't have an account?

Can someone help me combine two triggers into one?
I wrote a second trigger for the Opportunity object in the sandbox and it works, but I would like to combine it with an existing Trigger in Production. Can someone help me combine them? I read some posts about doing it, but I don't understand enough about coding to follow them.
They're basically the same. I cloned the Trigger and Apex Class and changed the name.
Thanks
They're basically the same. I cloned the Trigger and Apex Class and changed the name.
Thanks
trigger OpportunityTrigger on Opportunity (after delete, after insert, after undelete, after update, before delete, before insert, before update) { OpportunityTriggerHandler handler = new OpportunityTriggerHandler(true);
trigger OpportunityTriggerLargeAwards on Opportunity (after delete, after insert, after undelete, after update, before delete, before insert, before update) { OpportunityTriggerHandlerLargeAwards handler = new OpportunityTriggerHandlerLargeAwards(true);
Try the following trigger it works for you:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
It won't save. The error is:
Error: Compile Error: Duplicate field: handler at line 15 column 41
Try the following trigger it works for you: I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha