I have a managed package that has an AfterInsert trigger on Opportunity which updates contact records. I've been asked to write a separate AfterInsert trigger on Opportunity in order to update different fields in contact records. The new trigger is independent and will not cause any recursion with the managed trigger.

However, it's possible that in either a single record insert or a bulk insert, the same contact may need to be updated by both triggers. Will this throw an error?




There won't be any errors with both triggers. Even if the triggers affected the same fields, there would be no error (it would be undefined which value would win, however). The triggers execute in an undefined order, but effectively act as if they ran concurrently; the results of each trigger are aggregated together.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.