0

I am trying to create a managed package version, but getting the below error. I can see the QuoteSetting is enabled in my project-scratch-def.json. I know that this will anyway not getting executed while creating the package version, But is there any way we can enable it inside the sfdx-project.json file or did I miss anything? Quote__c is actually a lookup for Address object.

Address.Quote__c: referenceTo value of 'Quote' does not resolve to a valid sObject type
Quote-Quote Layout: Parent entity failed to deploy
Quote.CreateAddress: Invalid object name Quote.CreateAddress
Test_PS: In field: field - no CustomField named Address.Quote__c found

My sfdx-project.json file

{
    "packageDirectories": [
        {
           "path": "force-app-core",
           "default": true,
           "package": "app_core",
           "versionNumber": "1.1.0.NEXT"
        }
    ],
    "namespace": "app_core",
    "sfdcLoginUrl": "https://login.salesforce.com",
    "sourceApiVersion": "50.0",
    "packageAliases": {
        "app_core": "0Ho......",
        "[email protected]": "04t......",
        "[email protected]": "04t......"
    }
}

project-scratch-def.json file

{
  "orgName": "Test Core App",
  "edition": "Developer",
  "features": [
      "Communities",
      "EnablePRM",
      "ForceComPlatform",
      "PersonAccounts",
      "Sites",
      "StateAndCountryPicklist"
  ],
  "settings": {
        "communitiesSettings": {
            "enableNetworksEnabled": true
        },
        "lightningExperienceSettings": {
            "enableS1DesktopEnabled": true
        },
        "mobileSettings": {
            "enableS1EncryptedStoragePref2": true
        },
        "chatterSettings": {
            "enableChatter": true
        },
        "quoteSettings": {
            "enableQuote" : true
        }
    }
}
3
  • 1
    Are you specifying the definition file when you create the package version?
    – David Reed
    Feb 15, 2021 at 6:57
  • sfdx force:package:version:create --targetdevhubusername [email protected] --package 0Ho.. --versionnumber 1.1.0.NEXT --installationkeybypass --wait 10 --codecoverage - This is the command I've used. How to specify the definition file in it? Feb 15, 2021 at 7:07
  • oh yeah, got it @reed. Please answer it, then I can accept the answer. Feb 15, 2021 at 7:11

1 Answer 1

1

When you create a package version, you need to use the --definitionfile config/project-scratch-def.json option.

Providing a definition file configures the features and settings available in the build scratch org that's used behind the scenes to upload the package version. This will ensure that Quotes and the other required features you use in development scratch orgs are turned on.

You must log in to answer this question.

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