2

I created the Unlocked package (no namespace) with the common/dependency components like Account, Contact fields, and Custom labels which have been on Packaging org already, but I forgot and included them into the package.

So, when I created the package version and installed it to the org those components were overridden by package components. I added them by mistake and I have to return them back as they were. See below. enter image description here

Those fields and Custom labels are referenced across classes that are in the package and other classes that are in the org too. I want to uninstall the package and deploy everything via mdapi, but I cannot uninstall the package because of dependencies between the components.

I created the separate package with those fields and Custom labels and tried to install, but got the error that it could not be overridden with another package, obviously...

Is the only way here is to manually uninstall and comment (if referenced in other org metadata) those fields and Custom labels one by one from the package, then uninstall the package and deploy everything back via mdapi?

6

You can remove metadata from being part of the Unlocked Package in the UI. In the org where the Unlocked Package was installed, go to Setup/Installed Packages, click on your package name and then on the "View Components" button. You'll have a "Remove" button next to your elements.

This won't delete anything, just "unflag" your metadata from being part of your Unlocked Package. It will go back to the "happy soup".

You can then start from scratch, create a new Package Version with only the metadata you want, and install it again. Then you'll be able to install your 2nd package with your fields and custom labels.

Note that if you use metadata api, you can deploy whatever you want even if the metadata is already part of a package.

  • I thought it will delete not "unflag". Thank you! – m_konyk Dec 12 '18 at 9:07
  • Didn't know metadata api could deploy over unlocked package components - great answer! – Brian Miller Jul 10 at 20:19

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.