2

I have a regular custom object that was marked as Protected in my 1GP packaging org. It has been included in the last few releases of the package as Protected.

In my DX Scratch Org, I had to unprotect it so I could work on some new functionality. But when I did the source convert and deploy, it also updated the visibility in the packaging org to public.

Now, even though I haven't created a new version of the package, I can't find any way to reverse that in my packaging org - if I try via deployment, it says

"Cannot modify managed object: entity=CustomEntityDefinition, state=MANAGED_RELEASED, You can't reduce the visibility from Public to Protected for a released Custom Object."

And the visibility option is not visible in either classic or lightning object manager?

But if I haven't released this object with visibility set to public, why can't I still revert the visibility? I really don't want to include this object as public yet - it is supposed to be protected behind feature management. Is there some way I am not thinking of to revert this since I haven't packaged it up yet?

1

It sounds like you need to contact Partner Support. Try emailing them at partnersupport@salesforce.com.

In the future, you shouldn't change that setting from protected to public, even as a joke, because it is no laughing matter.

force:source:convert and force:mdapi:convert were meant as convenience tools for a one-time migration, and definitely should not be used as a regular part of your deployment process. Do yourself a favor and stop doing that. There's little to no reason you'd need to use those features on a regular basis. force:source:deploy and force:package:install should be your only two options if you use scratch orgs.

3
  • I'll raise a case and see what happens - but I fear once done, there is no going back, since the option disappears in the UI. Re the deployment options, I am using scratch orgs against a 1GP - so I thought I have to convert and then do a mdapi:deploy to the package org, or is that no longer true? – BritishBoyinDC Mar 11 '20 at 12:58
  • Based on this article: developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/… – BritishBoyinDC Mar 11 '20 at 13:00
  • 1
    @BritishBoyinDC For the former, Partner Support can often undo "permanent" mistakes. I don't know their limits, but I do know they've saved me at least once in the past. For the latter, force:source:deploy is far simpler. The doc in question is pre-force:source:deploy to any org. You may also want to start preparing for the eventual move to 2GP managed packages. The current migration path requires uninstall/reinstall for all customers to upgrade, but hopefully they'll fix this soon. – sfdcfox Mar 11 '20 at 13:56

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.