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

Solution Components

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.

dynamics crm solution framework

Figure 1: Sub-Components when adding an Account entity to the solution

 

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
option set

Figure 2: Custom Field 1 option set with four values

  • Export the “Solution A” as managed solution
  • Import “Solution A” in the target environment
account entity form in target environment

Figure 3: Field as shown on Account entity form in target environment

Solution Patch

Creating Patch

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.
clone a patch

Figure 4: Clone a Patch

 

Please note below that the <build> number is incremented automatically with an option for us to override.

cloone to patch

Figure 5: Clone to Patch Solution

 

This step will create a new solution (shown in the figure below) with “Solution A” as the base.

solution patch created

Figure 6: Solution A Patch created

 

The patch solution will always start as blank. You can add new and existing components and make necessary changes as required.

patch solution blank

Figure 7: Patch Solution “blank”

 

For this patch, I’ve completed the following steps:

  • Added the following components and sub-components to the solution:
  1. Account entity
  2. Account form
  3. Custom Field 1
solution components

Figure 8: Account entity added to the Patch Solution

  • Changed the values in Custom Field 1 and added a new Custom Field 2
  • Deleted Option Set “Value 2” and added new “Value 4”
option set values changed

Figure 9: Option Set values changed

 

custom field 2 added

Figure 10: Custom Field 2 added

 

  • 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.

patch applied to solution

Figure 11: Patch 1.0.1.0 applied for Solution A

 

Similarly, other Patches can be applied for Solution A and so on.

second patch for solution

Figure 12: Second Patch for Solution A

 

cloone to patch 2

Figure 13: Patch 1.0.2.0 for Solution A

Rolling Patch

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.

clone solution

Figure 14: 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.

clone to solution

Figure 15: Revised version of Solution A

 

consolidated and revised solution

Figure 16: Solution A consolidated and revised.

 

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.