Dynamics CRMSolution Enhancements in CRM 2016
In earlier versions of CRM (before 2016), when a solution was exported from one environment to another, the entity and all of its assets i.e. forms, views, relationships, visualizations, attributes etc. were exported. Exporting all unrequired assets could unintentionally modify objects on Target Environment or carry unintended dependencies.
In CRM 2016, solution patches can be created that contain ‘sub components’ of the entity that needs to be modified and then roll up the patches in the updated version of managed solution and export the updated version in target environment. In the section below, we look at how ‘clone to patch’ and ‘clone to solution’ features work in CRM 2016 to accomplish the above.
Clone to Patch
Example: Suppose there is a ‘Base Solution’, with all assets of Account and Contact entity but now we want to edit the length of field say ‘Account Number’ from 20 to 40.
Step 1: Since this field is a part of ‘Base Solution’ and changing the field length is only requirement we will create a patch for the original solution. So we use ‘Clone as Patch’ option for ‘Base Solution’. Since it’s a patch, system allows only last two digits to be modified for versioning. This option creates a patch for the parent solution as shown below.
Step 2: Now in the patched solution we will only add the Account Number field of Account entity and update the field length to 40.
Step 3: When the patched solution is imported in another environment, it is applied on top of base solution and account number field is updated.
Things to note when creating patches:
- When a patch is created at that time the parent solution is locked and can no longer be modified.
- Patches can be installed on another environment only If the parent solution is present in that environment.
- Patches should be exported as managed and should be imported on top of managed parent solution.
- Do not use unmanaged Patch solutions in Production environments.
- Patch is always created for Unmanaged Parent solutions.
In the future, if any other changes are to be done in ‘Base Solution’, we can create another patch for the ‘Base Solution’ and follow the above procedure.
Clone to Solution
So now when we plan to have next version of solution, we use the option ‘Clone to Solution’. All related patches to the ‘Base Solution’ get rolled up in the newly created version of ‘Base Solution’ and the patches are deleted automatically.
If we want the upgraded solution to be imported on target environment, import the Upgraded Solution and then select the Parent Base Solution and choose option ‘Apply Solution Upgrade’. This option removes the previous parent solution and keeps the Upgraded new solution in the environment.
Thus with solution enhancements in CRM 2016, instead of making changes in the entire parent solution, solution patches can be created with the changed customizations and then with the help of Clone Solution option the patches gets rolled up and new version of parent solution is created.