0

I was under the impression that one of the reasons to mark components (such as Custom Labels) as protected is so they can be removed from a Managed Package with little to no fuss as they can't be depended on in unmanaged code. See SF Docs

I tried to remove a Custom Label from our package as it was protected but packaging failed with the error:

Can't create package version. Removing metadata components from a second-generation managed package is a pilot feature that requires acceptance into a pilot program

So I'm guessing it's only a 1GP feature with protected components and in order to delete even protected components you've gotta be in this Beta Program. Seems it's only possible to "Mark Deprecated" for Custom Labels too. Just not sure I see the benefits of using protected labels in 2GP then if their biggest advantage of being able to delete them isn't possible.

1 Answer 1

1

As the error says, it's a Pilot feature. That means that salesforce.com will likely open this up for all ISVs in the future, but they want to make sure that there are no bugs that could break package building before opening it up. Keeping the labels protected allows a path forward in the future to delete these components permanently. Unless you need to allow subscriber access to these labels, make sure you keep them protected for now.

1
  • It's a fair point to allow the path forward when the feature eventually comes around. It is a little bit unfortunate that it won't be a hard delete but at least customers will be able to delete from their orgs if they want. Cheers @sfdcfox
    – Shane Bird
    Commented Jan 14, 2022 at 14:16

You must log in to answer this question.

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