0

How do I define a dependency in 2GMP for certain Salesforce feature like Quote object?

I need to release a package extension which should depend on Quote object.

How should I define such dependency?

In 1GMP, it is enought just to include dependency in the code and it is automatically detected. What is the corresponding process for 2GMP?

I receive the following errors when I try to release my extension package

referenceTo value of 'Quote' does not resolve to a valid sObject type,
Quote is not available in this org due to insufficient privileges.
1

The line "definitionFile": "config/project-scratch-def.json", should be included in the sfdx-project.json file as following

{
    "packageDirectories": [
        {
            "path": "force-app",
            "default": true,
            "package": "Baseline",
            "versionName": "1.0.0",
            "versionNumber": "1.0.0.NEXT"
        },
        {
            "path": "quote",
            "package": "Quote Extension",
            "versionName": "QE 0.0.0",
            "versionNumber": "0.0.0.NEXT",
            "definitionFile": "config/project-scratch-def.json",
            "dependencies": [
                {
                    "package": "Baseline",
                    "versionNumber": "1.0.0.LATEST"
                }
            ],
            "default": false
        },

and the file config/project-scratch-def.json should exist and contain "quoteSettings": {"enableQuote": true} lines like following:

{
    "orgName": "Package Development",
    "edition": "Enterprise",
    "features": [],
    "settings": {
        "quoteSettings": {
            "enableQuote": true
        }
    }
}

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.