Tuesday, 18 October 2016

Want to delete a managed component? Use the clone solution feature in CRM 2016.



Have you ever had the need to delete a component present in a managed solution? Let’s say, I have a solution ‘Delete From Managed’ with two entities ‘Entity to Retain’ and ‘Entity To Delete’ at the development server. I export it as a managed solution and then import it at the production server. Everything works fine. Some stage later, you find that ‘Entity To Delete’ is no longer needed and you want to remove it from the production server, but you cannot do so because the solution is a managed one. What do I do now?

Before CRM 2016, there was a work around to this issue i.e. holding solution. In CRM 2016 I’ve found that we could use the clone solution feature to complete this task.

Let’s see it step by step.



The screen below shows my original solution.









First, I clone the solution at the development server.




























Notice that cloning solution increases the version number of the solution.

I then, delete the unused entity ‘Entity To Delete’ from the solution. I export it again as a managed solution and then import it at the production server.

The initial screen while importing, where I select the zip file, is shown below,












I click next and get the following screen,


















I click next again, and get the following screen,




















This is an important step. Here we need to make sure that we select the check box named ‘Stage for Upgrade’.

I click ‘Import’ and the import starts.

Once the import finishes successfully, your CRM instance will have two solutions,

  • DeleteFromManaged
  • DeleteFromManaged_Upgrade (CRM creates this renamed solution)


And you are presented the following screen,




















Click ‘Apply Solution Upgrade’.

CRM 2016 will create a solution named same as your solution, but with a suffix ‘_Upgrade’. CRM 2016 will automatically manage to delete the component for you, and at successful completion of this step, you will only have one final solution named ‘DeleteFromManaged’. The entity ‘Entity To Delete’ will no longer be present at the production server.



Hope this helps!!!





A simple and quick way to insert data into Many-to-Many relationship in Dynamics CRM is the Drag and drop listbox. http://www.inkeysolutions.com/DynamicCRMDragAndDropListBox.html

No comments:

Post a Comment