You need to sign in to do that
Don't have an account?
alaschgari
OpportunityTeamMember data is deleted, if I change opportunity owner
Hey folks,
I experience a OpportunityTeamMember data deletion, if I change the owner of the opportunity.
How can I prevent this? Even with a new owner I want to keep the opportunity team!
Thank you ver much
Josh :-)
That's the default behavior. I believe you'd have to use an asynchronous call to load those team members back in after they are deleted, but I haven't specifically experimented with this.
Hey sfdcfox,
thanks for the reply. I found a solution.
I got inspired by another board post where the post creator described the same behavior with OpportunityShare objects:
The Opportunity Team Members are stored in a text field and after the update a parser reads the text field and rebuilds the objects.
Here's my adapted solution:
Have fun!
Josh :-)
Well, as long as it's all happening in the same transaction, you wouldn't need a field to store this information; a simple static map would suffice, as they survive across triggers within the same transaction, but nevertheless, I like it.
Really?
I didn't know that. I will check that out soon! Thanks!!!
will the above code work in my org as is or is there something i will need to change to get it to work? i am facing the exact same issue and would like to keep the old opportunity team members even when the opportunity owner is changed