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
Tracy Flieder 9Tracy Flieder 9 

Auto populate Opportunity owner field with manager when User (original Opty owner) is de-activated.

When a User record is deactivated, we need to auto-populate any existing Opty records with their active manager (as noted in the user record), so those Opty records always have an active owner and are not sitting in limbo with a de-active user.  We want to automate this process.  
Any suggestions on best approach? 
Thank you, 
T
 
Best Answer chosen by Tracy Flieder 9
VamsiVamsi
Hi,

Create a Trigger on User object and check if User is de-activated then get all the open opportunities on which this User is a owner and then update the opportunity owner from this User to user's Manager User.

Hope this helps...!!

Please mark as best answer if the above help..!!!