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
fundooMentalfundooMental 

How to track changes to default Account Team

Hi,

We have a requirement where whenever an Account is created in salesforce we are changing the account owner to some "XYZ" user always. This is done through trigger and working fine (in before trigger we are doing this). But now we have requirement that the person who actually initiated the account creation his/her "Default Account Team memebers" should get added to this Account Team. This should be fine too and I think can be achieved through trigger. Now the biggest challenge is, the requirement also says that whenver this person adds/removes/modifies any account team member in his/her default account team it should reflect in all accounts where actually he initiated the account creation. OK fine, I can capture in one custom field that who actually initiated the account creation (as we are changing the account owner to XYZ user always) but how do we track changes to the default account team members? We cannot write triggers or workflows on AccountTeamMember object and UserAccountTeamMember object then how would I capture the changes this user made to his/her account team to be reflected in all accounts this user initiated the creation? Please help.

Please ask questions if I am not clear. Thanks

pconpcon

Unforunately there is nothing you can do about that is really good.  First I would vote on this [1] IdeaExchange post.  You could then solve this in one of two ways.  You can create a custom Account Team Member object that you control.  Then create a trigger on this object that copies the data into the standard AccountTeamMember object.  This would allow you to inject your logic.  Your other option would be to use scheduled apex to possibly query the AccountTeamMember changes and do what you need.  This has problems since it is not instant you can run into issues when multiple changes are made during your running window.

[1] https://success.salesforce.com/ideaView?id=08730000000YR8IAAW
fundooMentalfundooMental
I guessed it. Thank you for the reply.