3

I'm creating a scratch org definition file (project-scratch-def.json) in order to create an Unlocked Package that will interact with Salesforce Knowledge.

I'm currently stuck when I try to add a piece of code that is using the IsMasterLanguage field, because this field is only accessible if knowledge base supports multiple languages (docs).

Because of this, I tried to define my scratch org definition file to enable at least 2 languages, but it's not working out for me. Here's my definition file:

{
  "orgName": "knowledge_dev",
  "edition": "Enterprise",
  "country": "US",
  "language": "en_US",
  "features": ["Knowledge", "Communities"],
  "settings": {
    "communitiesSettings": {
      "enableNetworksEnabled": true
    },
    "knowledgeSettings": {
      "enableKnowledge": true,
      "enableLightningKnowledge": true,
      "defaultLanguage": "en_US",
      "languages": [
        {
          "active": true,
          "name": "en_US"
        },
        {
          "active": true,
          "name": "de"
        }
      ]
    }
  }
}

If I remove the languages part from the above definition file, I can create a scratch org, but it won't have multiple languages enabled. However, when I add the languages part (i.e. when I use the above defintition file as is), I'm receiving the following error when creating a scratch org:

Failed to deploy settings to scratch org.

So my question is how to enable multiple Knowledge base languages via scratch org definiton file?

1

Managed to figure out the correct JSON structure. language needs to be an array within languages field.

{
  "orgName": "knowledge_dev",
  "edition": "Enterprise",
  "country": "US",
  "language": "en_US",
  "features": ["Knowledge", "Communities"],
  "settings": {
    "communitiesSettings": {
      "enableNetworksEnabled": true
    },
    "knowledgeSettings": {
      "enableKnowledge": true,
      "enableLightningKnowledge": true,
      "defaultLanguage": "en_US",
      "languages": {
        "language": [
          {
            "active": true,
            "name": "en_US"
          },
          {
            "active": true,
            "name": "de"
          }
        ]
      }
    }
  }
}
| 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.