0

I want to build a package version of a third party library (Reltio) but I have a some errors that are popping up when I try to create a package version:

Request in progress. Sleeping 30 seconds. Will wait a total of 1200 more seconds before timing out. Current Status='Initializing'
Request in progress. Sleeping 30 seconds. Will wait a total of 1170 more seconds before timing out. Current Status='Verifying features and settings'
ERROR running force:package:version:create:  Multiple errors occurred:
(1) ReltioAccountCreateTest: Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccountsTest : Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccounts : Dependent class is invalid and needs recompilation:
 Class ReltioSearchHelper : Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccountsHelper : Variable does not exist: uri__c
(2) ReltioContactCreateTest: Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccountsTest : Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccounts : Dependent class is invalid and needs recompilation:
 Class ReltioSearchHelper : Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccountsHelper : Variable does not exist: uri__c
(3) ReltioHierarchy: Invalid field uri__c for SObject Account
(4) ReltioSearchAccounts: Apex class 'ReltioSearchAccounts' does not exist
(5) ReltioSearchContacts: Apex class 'ReltioSearchContacts' does not exist
(6) ReltioSearchAccounts: Dependent class is invalid and needs recompilation:
 Class ReltioSearchHelper : Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccountsHelper : Variable does not exist: uri__c
(7) ReltioSearchAccountsHelper: Variable does not exist: uri__c
(8) ReltioSearchAccountsHelper: Variable does not exist: SBC_Imported__c
(9) ReltioSearchAccountsTest: Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccounts : Dependent class is invalid and needs recompilation:
 Class ReltioSearchHelper : Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccountsHelper : Variable does not exist: uri__c
(10) ReltioSearchContacts: Dependent class is invalid and needs recompilation:
 Class ReltioSearchHelper : Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccountsHelper : Variable does not exist: uri__c
(11) ReltioSearchContactsHelper: Dependent class is invalid and needs recompilation:
 Class ReltioSearchHelper : Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccountsHelper : Variable does not exist: uri__c
(12) ReltioSearchContactsTest: Dependent class is invalid and needs recompilation:
 Class ReltioSearchContacts : Dependent class is invalid and needs recompilation:
 Class ReltioSearchHelper : Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccountsHelper : Variable does not exist: uri__c
(13) ReltioSearchHelper: Dependent class is invalid and needs recompilation:
 Class ReltioSearchAccountsHelper : Variable does not exist: uri__c

I noticed that Account object fields SBC_Imported__c and uri__c are in a different package.

While I can attempt to bring in those fields into this package, I was also thinking that perhaps I could use unpackagedMetadata setting in sfdx-project.json and specify the unpackaged folder (Being Lazy) just to build a version as those fields exist in another package.

So My sfdx-json:

{
    "packageDirectories": [
        {
            "path": "source",
            "default": true,
            "package": "my-reltio-package",
            "versionName": "ver 1.0",
            "versionNumber": "1.0.0.NEXT",
            "unpackagedMetadata": {
                "path": "unpackagedMetadata/UsedForVersionCreationOnly"
            }
        },
        {
            "path": "unpackagedMetadata/UsedForVersionCreationOnly",
            "default": false
        }
    ],
    "namespace": "",
    "sfdcLoginUrl": "https://login.salesforce.com",
    "sourceApiVersion": "52.0",
    "packageAliases": {
        "my-reltio-package": "0Ho6R2222000XZBKSA4",
        "[email protected]": "04t622222011OfuQAE"
    }
}

I then want to add the Account object and fields under there so that I have:

unpackagedMetadata->UsedForVersionCreationOnly->objects->Account (Account.object-meta)->fields(uri__c.field-meta/SBC_Imported__c.field-meta

I get the same errors as above. So it does not seem to be respecting the unpackagedMetadata setting. What am I doing wrong?

1
  • If these fields are from another package, are they part of a namespace?
    – Phil W
    Commented Aug 19, 2021 at 6:17

1 Answer 1

1

unpackagedMetadata only works for such metadata that is already in your own org, not managed package metadata. To make a package work with a managed package, include it as a dependency in the Unlocked Package information:

"packageDirectories": [
  { ..., 
    "dependencies": [ 
      { "package": "packageIdOrAlias" } 
    ]
  }
]

This will allow the package version to see the contents of the managed package and use that metadata.

4
  • The two fields in question are in another unlocked package in my org. I was trying to avoid adding a dependency to the package and wanted to create a package version as the metadata exists in prod. This is related to the other question you answered for me salesforce.stackexchange.com/questions/354370/… @sfdcfox Commented Aug 19, 2021 at 17:24
  • @jini If it's your own stuff, I don't see why you couldn't, but I wouldn't personally recommend it. That's kind of how Unlocked Packages are meant to be.
    – sfdcfox
    Commented Aug 19, 2021 at 18:43
  • makes sense. Thank You Commented Aug 19, 2021 at 18:48
  • @sfdcfox I had Similar issue with picklist salesforce.stackexchange.com/questions/369585/…
    – NITHESH K
    Commented Feb 17, 2022 at 6:36

You must log in to answer this question.

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