4

Given the project-scratch-def.json:

{
  "orgName": "My Org",
  "edition": "Developer",
  "features": [
    "LiveAgent",
    "AuthorApex",
    "TerritoryManagement",
    "ServiceCloud",
    "Knowledge",
    "Communities"
  ],
  "settings": {
    "orgPreferenceSettings": {
      "networksEnabled": true,
      "s1DesktopEnabled": true,
      "chatterEnabled": true
    },
    "liveAgentSettings": {
      "enableLiveAgent": true
    },
    "communitiesSettings": {
      "enableNetworksEnabled": true
    }
  }
}

And sfdx-project.json:

{
  "packageDirectories": [
    {
      "path": "src", "default": true
    }
  ],
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "45.0"
}

After running this command:

force:org:create -f config/project-scratch-def.json -a org-SCRATCH -v org-DEVHUB -s -d 29

I get this error:

Error shape/package.xml The object 'Communities' of type Settings metadata does not exist.

This is weird because Metadata Coverage report provides these settings:

{
  "orgName": "Sample Org",
  "edition": "developer",
  "features": [
    "COMMUNITIES"
  ],
  "settings": {
    "communitiesSettings": {
      "enableNetworksEnabled": true
    }
  }
}

But it doesn't work as well.

2 Answers 2

10

Your API version is set to 45.0 (and/or your Dev Hub may not be on Winter '20 yet). On that API version, the networksEnabled setting lives in orgPreferenceSettings, e.g.,

  "features": [
    "Communities"
  ],
  "settings": {
    "orgPreferenceSettings": {
      "networksEnabled": true
    }
  }
2

As of v49.0, there are now force:community commands in sfdx!

Salesforce CLI Command Reference: community Commands

You must log in to answer this question.

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