2

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.

6

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
    }
  }
| improve this answer | |
1

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

Salesforce CLI Command Reference: community Commands

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.