Sub topic 10
Account teams and team roles
This chapter assumes you know org-wide defaults (OWD), record ownership, and the role hierarchy. It also assumes you can read basic SOQL. An account team lets the owner of an account add other users to it. Each member gets a team role and an access level for that account. Teams give extra access to individual accounts without a sharing rule or a change to the OWD.
What an account team does
Suppose the Account OWD is Private. The account owner, and everyone above the owner in the role hierarchy, can see the account. A solutions engineer in another branch of the hierarchy cannot. The owner adds that engineer to the account team with Read/Write access. The engineer can now open the account.
Team access can only open access up. It cannot go below the OWD. If the OWD is Public Read/Write, a team member with Read Only access still gets Read/Write through the OWD.
Team roles and access levels
A team role is a label such as Sales Rep, Executive Sponsor, or Solutions Engineer. The role describes what the person does on the account. It does not control access.
The access level controls access. For the account itself it is Read Only or Read/Write. For related contacts, opportunities, and cases the options depend on the OWD and your org's settings. Admins define the list of team roles in Setup. Users can add members only if the Account Teams feature is turned on and the layout shows the Account Team related list.
Teams come in two forms:
- Account team: members are added one by one on each account.
- Default account team: a user saves a list of members and roles. Those members are added to each new account that user owns. Existing accounts change only if the user chooses to apply the default team to them.
How it is stored
Each member is an AccountTeamMember record. Salesforce also writes a row in AccountShare with the row cause Team, which is what grants the access.
SELECT Id, AccountId, UserId, TeamMemberRole, AccountAccessLevel
FROM AccountTeamMember
WHERE AccountId = '<account record Id>'This query returns one row per member, with the team role and the access level to the account.
The flow of access
Common errors
- Expecting a team role to restrict access. The role is only a label.
- Giving Read Only to a user whose OWD already allows more. The user keeps the higher access.
- Using account teams for large groups. Dozens of members on thousands of accounts create many share rows. A sharing rule with a public group fits that case better.
- Forgetting that team access is per record. It does not apply to accounts the user is not on.
Exercise
The Account OWD is Private. A user is added to an account team with the role Executive Sponsor and Read Only access. What can the user do with that account, and what record proves the access?
Show answer
The user can view the account but cannot edit it. The role Executive Sponsor is only a label. The access comes from the Read Only access level, which is stored as an AccountShare row with the row cause Team, alongside the AccountTeamMember record.