You need to sign in to do that
Don't have an account?
Alaric Wimer
Need help with a Mass Update - change all account and contact owners to match the owner of the opportunities they are related to
I need some help with how to approach the following tasks.
1. I need to perform a one time mass update that will change all account and contact owners to match the owner of the opportunities they are related to.
2. (after the one time mass update is finished) when opp owner is updated also updated related contact and account owner to the new owner
I'm not really sure how to approach these in the most efficient way and safest way. I'm thinking an Apex trigger but would need some guidance with the code. Any help is greatly appreciated. Thank you!
Hi thanks for your reply! Here's the answers to your questions.
1. From the Opp, Account is lookup. Contact is related through Contact Roles. 2. Is there a guarantee?
2. Is there a guarantee? No, and that’s the current problem. This solution will guarantee that when the opp owner is updated, the contact and account owners will also be updated to match the same owner .
3. No such case is expected.
Thank you for the code with comments! That really helps me understand. I will be trying this in a testing environment soon and will let you know. I'm also interested in finding out how to do this for all future records. When opp owner is updated also updated related contact and account owner to the new owner.