Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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?

Thanks

David

share|improve this question

1 Answer 1

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

 
discard

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.