0

I cannot locate my customer community user in the account team, hence unable to assign the user to the team. Can we not add community users to Account team? Is there any work around?

2 Answers 2

2

You cannot add Customer Community Users in Account Teams. You can only add Internal Users or Partner Community Users to Account Teams. While this is not clearly documented anywhere, a good way to verify this is by attempting to add one in the Account Team.

In LEX, if you try searching for a Customer Community User while adding Users in Account Team, you won't get the User returned in the search result. If you switch to Classic, and try to add a User in the Account Team, you will see the option of only Internal and Partner User (sample screenshot below).

enter image description here

0

You can add Customer Community Plus Users license users in Account Teams with Apex code. You are not able to add it from UI. Adding users from the Apex code will automatically create a record in the AccountShare table.

AccountTeamMember accountM = new AccountTeamMember();
accountM.AccountId = <AccountId>;
accountM.UserId = <UserId>;
accountM.TeamMemberRole = 'Sales Manager';
accountM.CaseAccessLevel = 'Edit';
accountM.ContactAccessLevel = 'Edit';
accountM.OpportunityAccessLevel = 'Edit';

try {
    insert accountM;
    System.debug('successful added');
} catch (DmlException e) {
    // Handle potential errors, such as sharing rule conflicts or duplicate team members
    System.debug('Error adding Account Team Member: ' + e.getMessage());
}

I have tried this in my developer environment, and it works fine.

You can not add Customer Community Users license users from Apex. You will get this error if you try to add: Error: 20:11:06:025 USER_DEBUG [14]|DEBUG|: Insert failed. First exception on row 0; first error: OP_WITH_INVALID_USER_TYPE_EXCEPTION, Operation not valid for this user type: []

You must log in to answer this question.

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