Microsoft Dynamics CRM Solutions
“Solutions” in Microsoft Dynamics CRM is a way of packaging customisations and configurations developed in the system, which can then be exported and imported into different environments for testing, training and production usage.
With the release of Microsoft Dynamics CRM 2016, Microsoft added new solution concepts in the system as detailed in the following sections.
- Solution Components
- Clone a Patch
- Clone Solution
- Apply Solution Upgrade
Previously, when a component (e.g. Entity) was added to a solution, all its sub-components (e.g. fields, forms, views, relationships etc.) were also added automatically without giving an option to select one or two components which required a change.
With this release, Microsoft added a tighter control of all components that are added to a solution. Put simply, when a component is added to a CRM solution, you will now receive an option to select its sub-components as shown in the following screenshot.
I’ve created a solution, “Solution A”, and took the following steps:
- Added Account entity to this solution
- Added Account form as a sub-component
- Created a “Custom Field 1” Option set with four values as shown below in Figure 2
- Added this field on the form
- Saved and Published the Customisations
- Export the “Solution A” as managed solution
- Import “Solution A” in the target environment
Now, say a business is requesting a new custom field and a change in the option set values.
Perform the following steps to implement this change.
- In the development environment, go to Settings > Solutions.
- Select “Solution A” > click Clone a Patch.
Please note below that the <build> number is incremented automatically with an option for us to override.
This step will create a new solution (shown in the figure below) with “Solution A” as the base.
The patch solution will always start as blank. You can add new and existing components and make necessary changes as required.
For this patch, I’ve completed the following steps:
- Added the following components and sub-components to the solution:
- Account entity
- Account form
- Custom Field 1
- Changed the values in Custom Field 1 and added a new Custom Field 2
- Deleted Option Set “Value 2” and added new “Value 4”
- Once done, save and publish changes.
- Export this patch as managed solution and import into the target environment.
Please note, this patch requires the base solution “Solution A” to exist in the target environment before importing.
Account form looks like below after importing the Patch for Solution A. Note that “Value 2” is not deleted from the available Option Set values even if it was deleted from the source solution.
Similarly, other Patches can be applied for Solution A and so on.
Microsoft has done an incredible job by giving an option to consolidate all the patches in one Solution. Simply click on the base solution “Solution A” and click Clone Solution.
This step will delete and consolidate all patches into the base solution. This will also increment the <minor> version of the solution as shown below.
This summarizes the Clone to Patch and Clone Solution features of Microsoft Dynamics CRM.
In my next blog, I’ll discuss application of Solution Upgrade and Solution Packaging.