0

I am trying to shift a hybrid codebase to SFDX. I'm using Gitlab CI running in the default gitlab-runners and for some reason I haven't been able to discover I keep having my code deploys failing. I am using the force:source:push command and everything works locally. I get 3 errors mostly, 'Invalid type: Schema.Network', 'Could not resolve standard field's name.', and 'Variable does not exist: MiddleName'. From what I understand most of these have to do with the scratch org definition file, but that doesn't explain why deploying locally works just fine. My scratch org def file is,

{
  "orgName": "Name",
  "edition": "Developer",
  "features": [
    "API",
    "Communities",
    "CustomNotificationType",
    "Knowledge",
    "ProcessBuilder",
    "ServiceCloud",
    "LightningServiceConsole",
    "LightningSalesConsole",
    "LiveAgent",
    "RecordTypes",
    "Sites",
    "SiteDotCom",
    "Workflow"
  ],
  "settings": {
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    },
    "caseSettings": {
      "enableCaseFeed": true,
      "enableSuggestedSolutions": true,
      "showEmailAttachmentsInCaseAttachmentsRL": true,
      "useSystemEmailAddress": true
    },
    "communitiesSettings": {
      "enableNetworksEnabled": true
    },
    "nameSettings": {
      "enableMiddleName": true,
      "enableNameSuffix": true
    },
    "orderSettings": {
      "enableOrders": true
    },
    "ideasSettings": {
      "enableIdeas": true,
      "enableIdeasReputation": true
    },
    "orgPreferenceSettings":{
      "networksEnabled":true
    }
  }
}
0

1 Answer 1

1

Your scratch org definition appears to be correct. My hypothesis is that your CI system is not using it, or is using a different file.

'Invalid type: Schema.Network'

The features Communities and Sites, plus your communitiesSettings, make sure that your org has everything you need for Communities, including access to the Network entity.

'Could not resolve standard field's name.', and 'Variable does not exist: MiddleName'

I assume that these are referring to the same error. This would occur if the nameSettings you have specified here are not present.

You can safely remove

"orgPreferenceSettings":{
  "networksEnabled":true
}

which is now deprecated in favor of communitiesSettings.

1
  • Thanks for your help!
    – ara6893
    Jun 2, 2020 at 22:41

You must log in to answer this question.

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