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

Add/Remove User to Account Team then We Populate the User Value on Account


I have a Requirement. That is when ever Add User to AccountTeam(AccountTeamMember Object) we will retrieve Territory# from User and Compare To Account Field Territory# if it is not their we will populate. AND when ever delete User from AccountTeam The Territory# should be remove. we are look for another user with Same Role and populate that user Territory# on Account Field Territory#. But My Understandig is We Cannot write Triggers,Workflows and We cannot create Custom Button On accountTeam Section and we cannot Override Add Button. Could you Please give me the Suggestion how do build this Requirement.

Hi Santosh,

This wouldn't be straightforward but could be accomplished using apex and visualforce:
1)Create a VF page with custom button which can invoke a class - put this vf page on the Account page layout.
2)In the class - get the Account team members for this particular Account using AccountTeamMember object :

3)Then try updating the Territory for the Account team members using the approach as explained in the thread :