You need to sign in to do that
Don't have an account?

Help on AccountTeamMember trigger
All, below is my trigger which increases sharing access when a new Account Team Member is entered on an account. Trigger works fine but this trigger does not run when new Account Team Member is created. It only works when account is updated (which I understand because I have created a trigger on Account object). From what I understand, triggers cannot be created on Account Team Member. Is there a workaround?
trigger teamsharing on Account (before update) { List<AccountShare> shares = new List<AccountShare>(); Set <ID> accids = New Set <ID> (); For ( Account A: Trigger.New) { accids.add(A.id); } List <AccountTeamMember> ATMs = [SELECT AccountId, TeamMemberRole, UserId, AccountAccessLevel FROM AccountTeamMember WHERE AccountId in: accids]; For (AccountTeamMember AT : ATMs ) { AccountShare aShare = new AccountShare(); aShare.AccountId = AT.AccountId; aShare.UserOrGroupId = AT.UserId; aShare.AccountAccessLevel = 'Edit'; aShare.ContactAccessLevel = 'Edit'; aShare.OpportunityAccessLevel = 'Edit'; shares.add(aShare); } Insert Shares; }
You can write trigger on Account Team Member instead of Account. Try the below one: Let me know, if you need any other help.
Thanks,
Neetu
I don,t think we can write trigger in Account Team Member .
Check with below code it may help !!
https://developer.salesforce.com/forums/?id=906F000000093bdIAA