Dynamics CRM 2016 introduced the concept of solution segmentation, solution patching and cloning and indeed it has come a long way over the last 2-3 years. We are now exposed to CDM, flows, powerapps and what not. But CRM has some old tricks up it’s sleeve which makes you go back to the basics sometimes and I am going to pen down one such scenario here. Even experienced consultants in CRM are sometimes bamboozled by this problem and I hope this is going to benefit my blog readers.
So here is the problem
- Source Environment (Env X) has a custom field of type Optionset – “new_FieldToBeDeleted” for Entity – Account (named it explicitly for this blog. Don’t follow such convention for stupid names ) . The field is Local Optionset.
- The field is placed on the form of the account.
- The solution from Env X is exported as managed and deployed to target environment (Env Y).
- Because of change of requirement, the local optionset now deleted from the source and replace with a global optionset.
The question now arises. How to delete the field from the target environment? It is a managed solution. Hence if you try to delete the field, you will receive an error. Also importing the new managed solution from source won’t help in this case.
Fortunately there is one way to do so with the help of Clone Solution feature.
- In the solution in the source environment, do all the necessary changes like removing dependencies, deleting the local optionset field, creating a global optionset and creating a new field in Account Entity to map to the global optionset.
- Select the solution and click on Clone Solution.
- Put a version number as asked for.
- Export the solution as managed.
- While importing the solution in the target environment, check the box – “Stage for Upgrade” and select the option – “Maintain customizations”.
- Once the solution is imported click on Apply Solution Upgrade button. The field in the target would be deleted as well and you will see the new field in your target environment.
Hope this helps next time you have trouble with your solution management.