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
LaurenP6777LaurenP6777 

Tracking Deletes on Account Team Members

HI Everyone, 

My org is in desperate need of allowing users to delete themselves from Account Teams. HOWEVER, we don't want users to be able to delete OTHER users. I could easily write a trigger to do that but when i try, the system says I can not write triggers on the Account Team Object. My next plan was to track deletes so I could monitor users that are deleting other users- but, again, I hit a road block bc you can't report on Account Team deletes. In fact, account team deletes don't even go into the sandbox. 

Does anyone know of a way to query (within the system) all Account Team members that have been deleted? SFDC says to use the "getDeleted()" function but it seems like that is only for the SOAP Api. I just want to quickly pull a query of deleted account team members and the last modified by. 

If anyone has a solution, please let me know. THANK YOU!!!!!!!!!!!!!!!!!
Best Answer chosen by LaurenP6777
pconpcon
Unfortunately it doesn't look like you can do a trigger on AccountTeamMember, so I think you would have to write a custom VF component to list the account team members.  And then in that component control if the user can see the delete button.

All Answers

pconpcon
Unfortunately it doesn't look like you can do a trigger on AccountTeamMember, so I think you would have to write a custom VF component to list the account team members.  And then in that component control if the user can see the delete button.
This was selected as the best answer
LaurenP6777LaurenP6777
That is EXACTLY what I ended up doing. Thank you!
Sean ConlinSean Conlin
Hi Lauren,
Can you share the code you used for the VF component and trigger?
Aradhika Chawla 73Aradhika Chawla 73
Now We write trigger on AccountTeamMember