Loading

Add or remove Opportunity Team members with Data Loader

Udgivelsesdato: Oct 8, 2026
Beskrivelse

When you add an Opportunity Team Member in the user interface (UI), Salesforce automatically creates both an OpportunityTeamMember record and an OpportunityShare record. The OpportunityShare record is based on the "Opportunity Access" selected when the team member is added on the Opportunity Team Members page.

When you insert OpportunityTeamMembers through the API, you cannot directly specify the access level of the corresponding OpportunityShare record, so you insert each record individually. The two objects work as follows:

  • OpportunityTeamMember: Stores the association between a User and the Opportunity, as well as the user's role.
  • OpportunityShare: Establishes the user's actual access to the Opportunity.

When you insert team members through the API, their access is typically set to the least permissive default level of Read Only. Existing OpportunityShare records with a matching User and Opportunity Id combination are updated from their existing access level to "Read Only", and their sharing reason is updated to "Sales Team". There are a few exceptions, outlined in Specify access level when you import Account or Opportunity team members.

If you want a more permissive access level for a newly inserted team member, run a subsequent insert to the OpportunityShare object to set the desired level of access.

For example, a sales ops admin needs to onboard a new overlay sales team of 200 reps across 1,500 open Opportunities, assigning each an "Overlay Rep" team role with Edit access. This is too many to do manually in the UI.

Note: Complete all 3 steps in the order outlined for the team member's access levels to display properly in the UI.

Løsning

This article explains how to add Opportunity Team Members to Opportunities, and how to remove them, using Data Loader. To add members, insert OpportunityShare records first and OpportunityTeamMember records second, using the same file.

Add Opportunity Team Members With Data Loader

Step 1: Prepare the File

Prepare a file with the following columns:

  • OpportunityId: The record Id of the Opportunity to which a team member is being added.
  • UserId: The Id of the user being added to the Opportunity Team.
  • TeamMemberRole: The Opportunity Team Role for this user on this Opportunity. To find the list of valid Team Roles, go to Setup | Customize | Opportunity | Opportunity Teams | Team Roles.
  • OpportunityAccessLevel: The Opportunity access level for the team member (UserId). Valid values are "Read" or "Edit". The value is case sensitive.

Step 2: Insert the OpportunityShare Records

Open Data Loader and select the Insert operation on the Opportunity Share (OpportunityShare) object to set the appropriate OpportunityAccessLevel for the team member users. To find the object, select the "Show all Salesforce objects" option in Data Loader. Click Browse, select your file, and click Open | Next | OK.

  • Select the Create or Edit a Map button and choose Auto-Match Fields to Columns. Verify that the OpportunityAccessLevel and OpportunityId fields mapped automatically, and manually map the UserId column to the UserOrGroupId field in Salesforce.
  • Select the directory where the success and error files should be saved, then click Finish.

Step 3: Insert the OpportunityTeamMember Records

Using the same file, perform a second Insert operation on the Opportunity Team Member (OpportunityTeamMember) object. To find the object, select the "Show all Salesforce objects" option in Data Loader. Click Browse, select your file, and click Open | Next | OK.

  • Select the Create or Edit a Map button and choose Auto-Match Fields to Columns. Verify that the OpportunityId, UserId, and TeamMemberRole fields are properly mapped.
  • Select the directory where the success and error files should be saved, then click Finish.

Note: Insert the Opportunity Share records before the Opportunity Team Member records. This ensures that the existing share records are properly linked to the newly created team members. If you insert share records after team members, the team member access levels in the UI may not reflect the share record's access levels.

Once the share and then team member records are inserted in the correct order, they are linked to one another. Subsequent updates to the share records are then reflected in the related team member's access level in the UI.

Remove Opportunity Team Members With Data Loader

  1. Run an Export operation in Data Loader against the Opportunity Team Member (OpportunityTeamMember) object. Set filter conditions of your choosing to selectively export the desired Opportunity Team Member records, and store a backup of the existing Opportunity Team Member records.
  2. When you are satisfied with the contents of your file, perform a Delete operation in Data Loader, mapping the Opportunity Team Member's Id column.

Note: Deleting an OpportunityTeamMember record also removes the team member's OpportunityShare record, and the team member record is not placed in the Recycle Bin.

Vidensartikelnummer

000383667

 
Indlæser
Salesforce Help | Article