[SalesForce] Unable to push-upgrade managed app after deleting packaged VF page

I just tried out the new feature Streamline Managed Packages by Deleting Unused Components that came with Spring'15 and deleted a managed VF page called "Advanced Lookup Popup" including its Controller class from my package.

I now push-upgraded an existing customer org and it failed with this error:

This app can't be upgraded. Salesforce has blocked this package
upgrade because the new package version removes some Apex code that
one or more Visualforce pages or global Visualforce components need in
order to function. Please contact your partner with this error
information. Provide these component names to your partner.
Visualforce Page: Advanced Lookup Popup.

How can I resolve this? Or is this a bug?

Best Answer

We just got this answer from Salesforce.com Support regarding our related case.

There is this knowledge article for this kind of problem Removing Obsolete Visualforce from Managed Packages

Eric Adding to the answer

If you have already deleted and packaged up the changes to a new package you will need to follow the below steps to upgrade users to the new package version:

  1. Create a patch from the previous version WITH the VF pages
  2. In the patch update all VF pages to simply <apex:page />
  3. Upgrade the customer to the patch version
  4. Upgrade the customer to the latest full version with the pages deleted

Basically you need to upgrade to a version with the metadata modified to not reference anything first then you can update to the packages with the metadata deleted.

Related Topic