function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Leonard Silon 11Leonard Silon 11 

How do I keep the oppty owner the same when changing account owner?

We all know that when changing the account owner, the oppty owner changes in certain situations. We all also know that this event is not really an update to the oppty record.

Knowing those items, how can I prevent the oppty owner changing when the account owner is changed if I click none of the radio buttons on the account owner change screen?
Best Answer chosen by Leonard Silon 11
Abdul KhatriAbdul Khatri
In Account BeforeUpdate Trigger you can grab all the related opportunity information including owner into an static variable and then Account AfterUpdate Trigger you can revert back opportunity owner wherever changed stored in that static Variable.

Let me know if this helped