Search code examples
salesforcesalesforce-development

How do I create a scratch org with Salesforce Platfom licenses?


I'm setting up a new scratch org to deploy a source code we developed in a sandbox. Our project uses Salesforce platform license and our profile definitions are built using this license.

When I create a new Scratch org with the Enterprise edition, I do not get the Salesforce platform license and so I am unable to deploy my source files.

I need the Enterprise edition (and not Developer edition) as my source also has communities enabled and the guest user license is different in Developer edition. Developer edition scratch orgs come with a 'Guest' license type as opposed to the 'Guest User Licence' license type which is in my Sandbox and Enterprise editions.

The project-scratch-def.json file I am using is given below

{
  "orgName": "Demo Company",
  "edition": "Enterprise",
  "features": [],
  "settings": {
    "orgPreferenceSettings": {
      "networksEnabled": true,
      "offlineDraftsEnabled": true,
      "pathAssistantsEnabled": true,
      "s1DesktopEnabled": true
    }
  }
}

Solution

  • Answer from Salesforce support was to include the ForceComPlatform value in the Features array.

    Something like

    {
      "orgName": "Demo Company",
      "edition": "Enterprise",
      "features": ["ForceComPlatform"],
      "settings": {
        "orgPreferenceSettings": {
          "networksEnabled": true,
          "offlineDraftsEnabled": true,
          "pathAssistantsEnabled": true,
          "s1DesktopEnabled": true
        }
      }
    }
    

    This created a scratch org for me with 1 Salesforce Platform license.