You need to sign in to do that
Don't have an account?
tonante
Keep Opportunity Team Members using Apex when Changing Account Owner who is also an Account Team Sales Director
HI: I just wanted to solicit comments or ideas concerning this issue:
We need to programmatically keep the Opportunity Team Members and Send an email to the new account owner instead of doing it manually. So we'd use a trigger.
I know there is an idea out on the Success Community which is up for votes on how to handle this but has not reached the vote limit to pass yet:
https://success.salesforce.com/ideaView?id=08730000000cGUJAA2
However can't we just do these following procedural steps in Apex? Please let me know your ideas or comments because I really want to know if this makes any sense before I code it. Thanks much for your help:
If account owner is changing:
We need to programmatically keep the Opportunity Team Members and Send an email to the new account owner instead of doing it manually. So we'd use a trigger.
I know there is an idea out on the Success Community which is up for votes on how to handle this but has not reached the vote limit to pass yet:
https://success.salesforce.com/ideaView?id=08730000000cGUJAA2
However can't we just do these following procedural steps in Apex? Please let me know your ideas or comments because I really want to know if this makes any sense before I code it. Thanks much for your help:
If account owner is changing:
- Select each Opportunity Team Member (OTM) object using the Opportunity's Account Id
- Delete the old Account Team Member (ATM) Role of Sales Director
- Store the OTM object in a list of OTMs
- Insert the new Account Owner as the ATM's new Sales Director.
- Upsert the OTM list.
- Send email to the new Account Owner.