Solution imported previously fails during uninstallation or upgrade with error "'Role' with ID is required by the solution"
A solution that was imported in a previous version (for example, in Dynamics CRM) fails during uninstallation/upgrade with an error message similar to 'Role' with id [RoleID] is required by the [SolutionName] solution. This article provides a resolution for this issue.
Applies to: Microsoft Dynamics CRM
Original KB number: 4025516
Before an upgrade to the December 2016 update for Microsoft Dynamics 365, a solution containing a custom role is installed. After the org upgrade, the solution can no longer be uninstalled/upgraded because of a dependency between the Role and another solution, most commonly the System solution. This issue is not introduced or caused by the user.
In Microsoft Dynamics 365, Business Process Flows (BPFs) are represented by first class entities that adhere to the Microsoft Dynamics 365 security model just like any other entity. These entities are generated during the December 2016 upgrade to Microsoft Dynamics 365. To ensure that all existing roles have the appropriate access to the BPFs, BPF privileges are automatically assigned to existing roles during upgrade. In certain cases, these privilege assignments can result in incorrect dependencies between solutions.
In Microsoft Dynamics 365, navigate to Settings > Security > Security Roles. Then select the security role that appears in the error and open the Business Process Flows tab.
Take note of the privileges that are assigned for the BPFs. A screenshot is useful, since it is a visual representation.
Clear all privileges and then save the changes. This should remove the problematic dependencies.
You may not be able to edit the privileges if the Role is part of a solution and is marked non-customizable. If the solution is unmanaged, you can update Customizable managed property of the role and proceed. In case of a managed solution, contact Microsoft Support to make the role customizable.
Reassign the privileges that were previously assigned, and then save and close the dialog. This will ensure that the required access to different roles is kept.
There may be dependencies between multiple roles and solutions. In this case, do the preceding steps for each of the roles that are being reported with issues.