Print this page

Add or remove Account Teams using Data Loader

Knowledge Article Number 000006678
Description Steps to create or delete Account Teams using Data Loader. For more details regarding the use and implications of adding team members see Adding Account Team Members.

 
Resolution

Add Account Team Members to an Account using Data Loader

1. Prepare a file with the following columns:
 
AccountId: The record Id of the Account to which a team member is being added

UserId: Id of the User who is a member of this account team

TeamMemberRole: Role associated with this team member. To find the list of valid Team Roles, go to Setup | Customize | Accounts | Account Teams | Team Roles

AccountAccessLevel: The Account access level for the team member (or UserId). Valid values are "Read" or "Edit". Note all values for AccessLevel fields are case sensitive

ContactAccessLevel: The Contact access level for the team member (or UserId). Valid values are "None" "Read" or "Edit"

OpportunityAccessLevel: The Opportunity access level for the team member (or UserId). Valid values are "None" "Read" or "Edit"

CaseAccessLevel: The Case access level for the team member (or UserId). Valid values are "None" "Read" or "Edit"
 
It's recommended to review the SOAP API Developer's Guide documentation to familiarize yourself with the AccountShare object's AccessLevel field's requirements listed in each field's description.

Note: If your organization's has Set Your Organization-Wide Sharing Defaults to Public Read/Write for Accounts the Account Share (AccountShare) object in step 2. will not be available and you may proceed directly to step 3. to add Account Team Members.

2. Once the file has been prepared, open the Data Loader and choose to perform an Insert operation to the Account Share (AccountShare) object to establish AccountAccessLevel, ContactAccessLevel, OpportunityAccessLevel, and CaseAccessLevel access for the users. The Account Share object should be available by selecting the "Show all Salesforce objects" option in the Data Loader click Browse... and select your file | Open | Next > | Ok

- Select the Create or Edit a Map button and choose to Auto-match Fields to Columns. Verify that the AccountAccessLevel, ContactAccessLevel, OpportunityAccessLevel, and CaseAccessLevel and AccountId fields mapped automatically and manually map the UserId column to the UserOrGroupId field in Salesforce. Click OK and then verify the mapping is correct | Next>

- Click Browse... to select the location on your local machine where you want to save the output files.

- Click Finish and Yes at the prompt to proceed.


3. Using the same file now perform a secondary Insert operation to the Account Team Member (AccountTeamMember) object which should be available by selecting the "Show all Salesforce objects" option in the Data Loader click Browse... and select your file | Open | Next > | Ok
 
- Click the Create or Edit a Map button and choose to Auto-Match Fields to Columns. Verify that the AccountId, TeamMemberRole, and UserId are properly mapped and click OK | Next>

- Click Browse... to select the location on your local machine where you want to save the output files.

- Click Finish and Yes at the prompt to proceed.

Note: You must insert Account Share (AccountShare) records prior to Account Team Member (AccountTeamMember) records.

The order in which the records are created initially is important because when creating AccountTeamMembers through the API, the system automatically checks to see what sharing may have already be established for the users or team members via existing AccountShare records and update them accordingly. However, the system will not automatically check and update existing AccountTeamMember records when AccountShares are inserted or updated.

When inserting AccountTeamMember records the existing AccountShare records are checked and if a match is found the existing AccountShare's RowCause field is updated to the value "Team" (indicating that the AccountShare is now linked to the AccountTeamMember record) and the AccountTeamMember record will then use and display the access levels set via the previously existing and now linked AccountShare.

If you insert AccountShare records after inserting AccountTeamMember records, there is no automatic system check to link or update existing and matching AccountTeamMember records. This can result in a disconnect where AccountTeamMember records displaying one level of access in the user interface while the inserted AccountShare records storing a different level of access. Remember, the AccountTeamMember does not control sharing but instead, it simply displays the sharing afforded to the user via AccountShare records. Since no check and update is performed to the AccountTeamMember records they remain unchanged and may not accurately display AccountShare access levels.

So if AccountTeamMember records are inserted before AccountShare records, there can be some undesired side-effects:

1. If you add the AccountTeamMember first and there is no existing share, the Account Team will list the Account, Case, and Opportunity access as the default level

2. If you then add the AccountShare, the sharing model will be set, but the AccountTeamMember values will not be updated, refreshed or modified to indicate the new AccountShare access levels

3. If you add the AccountShare after the AccountTeamMember, the RowCause will be listed as Manual and not linked to the AccountTeamMember

Note: After initially inserting the Share records and then Team Member records to update or set the share record's RowCause to "Team" to properly link the two records together it's possible to run subsequent updates to the share records to update team member access levels.


Remove Account Team Members from an Account using Data Loader  
 
1. Run an Export operation via the Data Loader against the Account Team Member (AccountTeamMember) object. Set filter conditions of your choosing to selectively export the desired Account Team Member records and ensure that you have created and stored a backup of the existing Account Team member records.
 
2. When you're satisfied with the contents of your file perform a Delete operation via the Data Loader mapping the Account Team Member's Id column. Click OK and then verify the mapping is correct | Next>

- Click Browse... to select the location on your local machine where you want to save the output files.

- Click Finish and Yes at the prompt to proceed.
 
Note the following behaviors upon deleting an Account Team Member record:
 
- Deleting an AccountTeamMember record also removes Account Sharing entries set for the Account's related records via the team member's access levels.

- Neither the AccountTeamMember or its corresponding AccountShare record are placed in the Recycle Bin and therefore cannot be undeleted.

- When deleting an Account Team Member in the UI you're presented with an option to remove them from the opportunity teams of open opportunities associated with the account. Performing a delete operation against the Account Team Member object via the API does not remove manual created opportunity sharing records and performs the delete as if the "Remove this team member from the opportunity teams of open opportunities associated with this account" option is not selected.

Note: You may notice that with Data Loader Version 38 - all permissions are available when inserting just the "AccountTeamMember" object. This removes the necessity to insert the "AccountShareObject" first as you can set the permissions properly without following that step.


See Also:
Adding a Team Member to Multiple Records
How do I specify the Access Level when importing Account Team Members / Opportunity Team Members?
How can Opportunity Teams be added / removed using the Data Loader?




promote demote