+ Start a Discussion
santusantu 

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

Hi,

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.

Regards,
Santosh
Sonam_SFDCSonam_SFDC
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 : http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_accountteammember.htm

3)Then try updating the Territory for the Account team members using the approach as explained in the thread : https://developer.salesforce.com/forums/ForumsMain?id=906F00000008yGQIAY