2

So this is a weird scenario that I can't seem to find answers for. My team wants to push for the Salesforce DX Unlocked packaging strategy in a few months.

First off, its annoying because I have to create a trial org just to create test packages because I am told that once you create a DX package, you CANNOT delete a package or go down a version number. So our only way of testing out unlocked packages without pushing too many version numbers is to create a trial org.

The scratch orgs deploy with no problem now but when I deploy the same metadata project into an Unlocked Package in the trial org and create the new version, I get the following issue.

So we're using an "AccountsContactsRelation" object which is a standard object and NOT custom, but it only works when you enable the "ContactsToMultipleAccounts" feature, also in "Accounts" settings in the Setup menu. So when I deploy scratch orgs as usual, I need to put that feature to enable in the config file and it deploys without issues. But in a package, I have no way of doing such a thing.

Is this one of the many things that I cannot package? What if I have a package or another object's field dependent on this Object, will I still encounter errors or will it package OK without this object? Worst case scenario that it is not deployable in a package, will this object just reside regularly in the package and I can still be able to install this package alongside this and many other objects? Im sorry guys, yes I'm new to Salesforce in general. I picked up quite a bit the last few months but I have alot on the line here, I am a one man army as a contractor.

One thing I forgot to mention. When i create the package, I get the error below after running the package:version:create command “AccountContactRelation: invalid fullName, must end in a custom suffix ( for ex. __c )

3

If installation requires the ContactsToMultipleAccounts feature to be active then the destination org will have to enable prior to being able to install the package.

All standard dependencies work like this. If the org does not have or will not enable then they cannot install the package.

As for the version numbers and unlocked packages, they are a number like x.x.x.x

When packaging all are beta until you promote. The versions increment the last .x. Plenty of leeway to have many iterations of a beta

  • Right but the only problem, package creation command runs no problem. When you do the first version creation which pulls code from the project, it throws error: “AccountContactRelation: invalid fullName, must end in a custom suffix ( for ex. __c ) – Andrew Rendon Jun 12 '19 at 14:09
0

You need to add the definition file to the command when you are creating the version. You will need to make sure you have ContactsToMultipleAccounts in your features.

sfdx force:package:version:create -p fake_package --definitionfile config/project-scratch-def.json -d force-app -k test1234 --wait 10 -v dx

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.