0

My requirement is to update the account field when any account team member is added to it.

the below trigger invoke only when I made some changes in the account.

trigger AccountTeam on Account (after insert,before update, after update) {
}

WF, process builder doesnot provide accountteam How to update the account field when any new member is added to the account as a team member.

1
  • Are you just trying to count them? Use dlrs.
    – Adrian Larson
    Commented Mar 22, 2017 at 19:07

3 Answers 3

6

You have written a trigger on Account which won't fire on when a AccountTeamMember is inserted AccountTeamMember.

Unfortunately Triggers are not supported on AccountTeamMember Object.

You have few options:

  1. With a VF page- Best option:

    • Create a visualforce page to manage Account team members. Write logic in controller to update field on Account based on AccountTeamMember.
  2. Batch apex- no real time updates:

    • One other option is to use a batch apex, but the changes would not be in real time.
  3. Using a shadow object:

    • Create a shadow object, and write a trigger on it to update actual Account Team Member.
1
  • Hi Rahul, for me a scenario is Account team is creating/updating through integrations..I am looking at the 3rd option of creating shadow object..Can you please share more info how to implement this.
    – user7601
    Commented Jul 10, 2017 at 11:13
0

AccountTeamMember object doesn't support Apex trigger. Still, you have couple of options

  1. Create a trigger on Account object. It will only work when an account is updated or inserted. Not on Account Team Member addition. This won't while inserting AccountTeamMember record via Data Loader.

  2. Write a batch Apex that will fire every night, to perform the job.

  3. Create a Flow to update Account field and embed it on a Visualforce page. It will work when account team member is added to an account or Account is edited or inserted. But this won't while inserting AccountTeamMember record via Data Loader.

0

I realize this is an old post but, there is a solution Now Available on the AppExchange! - Custom Account Team Management System (CATMS) - The CATMS app allows you to build triggers and other automation that will execute when Account Team Member Records are Created, Edited or Deleted, while maintaining and enforcing access security and standard functionality for Account Teams.

1
  • 2
    Are you affiliated with this application? Stack Exchange policy requires you to disclose any affiliation.
    – David Reed
    Commented Mar 4, 2019 at 4:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .