Yet times uninstalling managed packages may lead to multiple issues if it doesn’t go unplanned. So we have to follow the series of steps to minimize the impact after it is removed.
Actions to do in the Test environment :
- Create a sandbox org to perform the uninstallation in the test environment.
- Get all the references (The simplest way is to try to uninstall & check the references)
- Replace the custom field references in
-
- Apex
- Visualforce
- Validation rules
- Workflow rules
- Flow
- Process Builder
- Approval Process
- Email Templates (both HTML & Text)
- Workflow Field updates
- Page Layout
- Reports
- Report Types
NOTE: We may need to create replacement fields for fields that need to be deleted.
Once the above steps are performed you should be able to uninstall the package.
Actions to do in the Production environment :
- Backup the data of all the reference fields as well as managed package objects.
- Deploy the replacement fields and update the data.
- Deploy all the components from the sandbox where the references are removed or changed.
- Uninstall the package.
Common errors:
Component is in use by another component in your organization
Most of the time you should be able to find the related component using the “Where is it Used” button available on the component. In case if you are unable to find the references, check all the inactive workflow rules. 99% of the time the missing references will be in the workflow rules.
This extension depends on the package you are trying to uninstall
This happens if there are dependent managed packages that have reference to the component which we are trying to uninstall.
Please check the date of installation if there is a dependency and remove them in the reverse order.