Clone a Patch, Clone Solution, and Apply Solution Upgrade are the cool new features released with Dynamics CRM 2016.
CRM Solution is an excellent way of transferring customizations from one environment to another and solution version helps to identify each set of customizations of transferring. CRM solutions will contain different components such as entities, processes, plugin assemblies, user roles etc…. There are two types of CRM solutions called unmanaged and managed. Usually, development environment of any CRM solution will contain the unmanaged solution and that will be transferred to test\production environment as a managed solution, which is not supposed to edit directly in those environments.
However when transferring CRM solutions from one environment to another, even if you change only one component or only one piece of a component you have to send the whole solution to the other environment to apply the change in the other solution. Also, the changes will be applied in the other destination environment as soon as you import the managed solution from the development environment.
Dynamics CRM 2016 has set of new features added to solve the above difficulty and has introduced a more methodical way of managing patches and solution versions. Following topics describe those new features in detail using a CRM solution named “CORE” containing 3 system entities(Contact, Account and User) and one custom entity(Application).
Initial version has been defined as 220.127.116.11 in the DEV environment.
Managed solution is imported to TEST environment as follows.
Clone a Patch
Assume that Application entity needs a new chart on it and it needs to be deployed immediately to the test environment as a patch of the last release.
You can use Clone a Patch option and create a new patch by selecting the unmanaged solution that you want the patch. It popups you to change only the patch and increment portions of the current version of the unmanaged solution.
Note: Important points on cloning a patch.
- Dynamics CRM doesn’t allow to clone a patch from another patch solution.
- Also, it doesn’t allow to clone a patch from any unmanaged solution
- You can add any number of patch solutions on the current Major.Minor version.
After setting new version to the patch, it creates a new CRM solution with the given version. You can add a new\existing component to be sent as a patch into the new patch solution.
When you are adding existing custom entities, by default the system popups you all the assets selected. You can unselect all and can select the relevant components that you need to include in the patch. When you are adding a system entity, by default no assets are selected.
Application Entity shows as follows in the patch solution.
Newly added Chart is shown in the Application inside the patch solution as follows.
After adding components to patch, you can export it as an unmanaged solution to send to the other\test environment. Multiple patches can be created for an unmanaged solution until it releases its next major version. Although the new changes added as patches, all the changes will be in the default solution and they can be added to the next major release.
Managed version of the patch solution imported to the TEST environment. Chart has been deployed correctly in to the TEST environment.
How to merge all the patches? This will be covered in the next topic.
Clone a Solution
When you need to send the next Major\Minor release of the solution with all the components in it, this is the option Clone a Solution. Once you clicked on Clone a Solution, it will popup you to select the Major.Minor portions of the current version.
After setting a new version, it will create a new unmanaged solution with the newly selected version. Also, it consolidates all the patches into the new solution version.
Staging is not a new concept to Dynamics CRM, but developers used to follow some unsupported ways or manual steps carried out to deal with staging. In the new version of Dynamics CRM it allows solution staging and it will hold all the components in it until it gets upgraded.
Apply Solution Upgrade
Once you receive cloned patches and cloned solutions to the destination environment, those will be staged in the destination environment. Once you select Apply Solution Upgrade option it will apply the changes came through cloned patches and through cloned solutions. Also, the system automatically consolidates the cloned solutions and keep only the latest solution in the destination environment.
Dynamics CRM allows Applying Solution Upgrade at the time of importing and after that too. Until applying the solution upgrade, the newly imported version\cloned solution will be staged in the Test environment.
However, this staging behaviour will solve another unsupported action that most of the developers taken when dealing with managed solutions. This will be discussed in the next post !