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
Nandhini S 3Nandhini S 3 

is it possible to add default account team of account owner using trigger or process builder?

AbhishekAbhishek (Salesforce Developers) 
Hi Nandhini,

This blog might answer your query,

https://developer.salesforce.com/forums/?id=9060G0000005gZnQAI

Thanks!
VinayVinay (Salesforce Developers) 
Hi Nandhini,

Try below snippet.
 
trigger TeamMemberTrg on Account(after insert) {
    if (trigger.isinsert) {
        set parentIds = new set();
        for (account acct: trigger.new) {
            if (acct.ParentId != null) {
                parentIds.add(acct.parentId);
            }
        }

        if (!parentIds.isEmpty()) {
            map mpAccs = new map([select id, ownerId from Account where Id in: parentIds]);
            List members = new List();
            for (account acct: trigger.new) {
                if (acct.ParentId != null && mpAccs.containsKey(acct.ParentId)) {
                    members.add(New AccountTeamMember(AccountId = acct.id, TeamMemberRole = ‘Account Manager’, UserId = mpAccs.get(acct.ParentId).OwnerId));
                }
            }

            if (!members.isEmpty())
                insert members;
        }

    }
}

Review below links that can give more information on Account teams.

https://help.salesforce.com/articleView?id=000313342&language=en_US&type=1&mode=1
https://success.salesforce.com/answers?id=90630000000gzCSAAY

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
Nandhini S 3Nandhini S 3
I need to add the account team assigned to the account owner
firdoss mohd 1firdoss mohd 1
Hi Nandhini,

It looks like our team of experts can help you resolve this ticket. We have Salesforce global help-desk support and you can log a case and our Customer Success Agents will help you solve this issue. You can also speak to them on live chat. Click on the below link to contact our help-desk. Trust me it is a support service that we are offering for free!

https://jbshelpdesk.secure.force.com

Thanks,
Jarvis SFDC team