My team and I have been facing an issue when trying to version an unlocked DX package that we have just created. This package, includes only classes, lightning components, and apex pages. Let's call it the 'developer package' for this exercise. The parent package has only custom objects and other admin dependencies we'd need to have the 'developer package' to compile. Let's call it the 'admin package'

Everything looks great in our 'developer package', however one field that was compiled and versioned on the 'admin package' keeps giving us issues.

The error when trying to version our 'developer package' is: System.QueryException: No such column 'Test_Record__c' on entity 'Vehicle__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

Please note that Vehicle__c is a Custom Object packaged in the 'admin package' and its field test_record__c is also part of this package.

We have set the dependency on the 'developer package' to this given package in our project.json file such as:

        "path": "force-app",
        "package": "developer-package",
        "versionName": "Developer Package 0.1",
        "versionNumber": "",
        "default": true,
        "dependencies": [
                "package": "Base",
                "versionNumber": "1.0.1.LATEST"
                "package": "Resources",
                "versionNumber": "0.1.0.LATEST"
                "package": "sf-common",
                "versionNumber": "0.1.0.LATEST"
                "package": "sf-common-classes",
                "versionNumber": "0.1.1.LATEST"
                "package": "Admin Package",
                "versionNumber": "0.1.0.LATEST"

Please note that the dependency is at "Admin Package" in the example above. The aliases were also added to the project.json file:

"packageAliases": {
    "Base": "0Ho3Z000000fxTdSAI",
    "Resources": "0Ho3Z000000fxTsSAI",
    "sf-common": "0Ho3Z0000008OKVSA2",
    "sf-common-classes": "0Ho3Z000000CaXUSA0",
    "AdminPackage": "0Ho3Z000000CaXPSA0",
    "DeveloperPackage": "0Ho3Z000000CaXZSA0",
    "DeveloperPackage@": "04t3Z000000DG4RQAW",
    "Base@1.0.40-17": "04t3Z000000DG2LQAW",
    "Resources@0.1.0-16": "04t3Z000000DG2QQAW",
    "sf-common@": "04t3Z000000DG3iQAG",
    "sf-common-classes@0.1.1.-8": "04t3Z000000DG3nQAG",
    "AdminPackage@0.1.1-10": "04t3Z000000DG21QAG"

I have tweaked some of the names above but tried keeping the "developer package" and "admin package" on it.

Of course, locally the developer package also has the metadata from the admin package, and the Test_Record__c field is in there.

I hope that was enough information, would anyone be able to pinpoint why exactly is this one field is giving us trouble? We have installed the admin package on a scratch org and we can see the field in there. Also, we only get errors when running the versioning command with --codecoverage in it, the exact error comes from a test class that is referring to the field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.