I'm trying to package an unmanaged package using opportunity teams, but each time I get the following error:

ERROR running force:package:version:create: Invalid type: OpportunityTeamMember

I tried following the advice in this post: Enable Account Teams in scratch org definition file, but it didn't work. Sales teams are enabled in my dev hub org, and the scratch org.

Has anyone been able to create a package version with Sales Teams?

update: Here is my project-scratch-def.json:

  "orgName": "Demo company",
  "edition": "Developer",
  "features": [],
  "settings": {
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    "securitySettings": {
      "passwordPolicies": {
        "enableSetPasswordInApi": true
    "mobileSettings": {
      "enableS1EncryptedStoragePref2": false
    "accountSettings": {
      "enableAccountTeams": true
    "opportunitySettings": {
       "enableOpportunityTeam": true 
  • so you enabled Opportunity Teams or Account teams in your Scratch org definition file? do you do any manual step related to OpportunityTeamMember after Scratch Org creation?
    – ytiq
    Commented Mar 2, 2021 at 20:00
  • Yes, I enabled the opp & account teams in my scratch org definition, and no I don't need to make any manual adjustments - the Opp teams are enabled when I create a scratch org.
    – hgolov
    Commented Mar 2, 2021 at 20:08
  • Strange but this post suggests that it's not possible / officially supported for Opportunity Team enabling in the scratch org settings. But you just mentioned you got it working in the scratch org itself... Commented Mar 2, 2021 at 20:28


You must log in to answer this question.

Browse other questions tagged .