Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?



share|improve this question
up vote 6 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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