0

I have developed an app in salesforce and created a managed package for the app, so that I can generate a installation url and send it to my client. But, the problem i have now is that, when I edit global methods in the controller and REST classes, I am getting this error:

Global/WebService identifiers cannot be removed from managed application

So, my question is, will I be able edit the classes if I delete the managed package? As the app has not been published, I don't have any problem deleting the package. I just want to know will this work, so that I can delete the package, edit the classes and create a new managed package.

EDIT: The managed package I created is a 1GP package.

4
  • Is this 1st or 2nd generation?
    – Phil W
    Commented Jul 21, 2020 at 7:05
  • i dont know what it means. i am new to saleforce. I have generated multiple installation urls (different versions), if thats what u mean. Commented Jul 21, 2020 at 7:08
  • Please look at 1GP and 2GP then edit the question to explain which type of managed package you created.
    – Phil W
    Commented Jul 21, 2020 at 7:37
  • It is worth reviewing the sections in the ISVforce Guide about building and packaging your solution if you are going to use managed packages. There are lots of non-obvious gotchas you really need to know if you're going to package.
    – David Reed
    Commented Jul 21, 2020 at 15:12

1 Answer 1

4

There are some options for this situation though what you do depends on whether you want to use the same namespace.

With a first generation managed package only a single package can use a given namespace so you won't be able to re-use that namespace with a new first generation package. However, you can create a second generation package in the same namespace and with the same code in it without any significant issues.

If you don't care about the namespace then just quietly forget about the 1GP, create a new namespace and use the code, adapted to the new namespace as needed, with a 2GP (or another 1GP, though I would recommend against that).

If you want to keep the namespace, the important points to note:

  • You'll need to register the namespace for your 1GP with your Dev Hub in order to allow you to create a 2GP using the same namespace.
  • You cannot install a 1GP and a 2GP that share the same namespace on a given org so you might need to abandon any orgs you had the 1GP on (if you face issues even after uninstalling the 1GP).
  • There are limitations as to what you can and cannot include in a 2GP. Check the latest Metadata Coverage Report for details.
3
  • 1
    The Metadata Coverage Report shows VF as compatible, FYI.
    – sfdcfox
    Commented Jul 21, 2020 at 14:49
  • Yeah, though called Apex Pages instead of Visualforce Pages, which might confuse :)
    – Phil W
    Commented Jul 21, 2020 at 14:53
  • Yeah, it's been called that since the introduction of the mdapi. They had a whole branding thing going on: ApexPage, ApexTrigger, ApexComponent... A bit overkill, if you ask me :D
    – sfdcfox
    Commented Jul 21, 2020 at 14:55

You must log in to answer this question.

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