Segmented Solutions and Patches in Dynamics CRM

Another awesome and useful feature that every system customizer waited for – Segmented solutions and patches  in MS CRM 2016.

Now we can export the solutions with entity fields, forms and views rather than entire entity using patches and cloned solutions.

Following things should be taken into consideration when you create a patch.

  • A patch represents an incremental minor update to the parent solution. A patch can add or update components and assets in the parent solution when installed on the target system, but it can’t delete any components or assets from the parent solution.
  • A patch can have only one parent solution, but a parent solution can have one or more patches.
  • A patch is created for unmanaged solution. You can’t create a patch for a managed solution.
  • When you export a patch to a target system, you should export it as a managed patch. Don’t use unmanaged patches in production environments.
  • The parent solution must be present in the target system to install a patch.
  • You can delete or update a patch.
  • If you delete a parent solution, all child patches are also deleted. The system gives you a warning message that you can’t undo the delete operation. The deletion is performed in a single transaction. If one of the patches or the parent solution fails to delete, the entire transaction is rolled back.
  • After you have created the first patch for a parent solution, the solution becomes locked, and you can’t make any changes in this solution or export it. However, if you delete all of its child patches, the parent solution becomes unlocked.
  • When you clone a base solution, all child patches are rolled up into the base solution and it becomes a new version. You can add, edit, or delete components and assets in the cloned solution.
  • A cloned solution represents a replacement of the base solution when it’s installed on the target system as a managed solution. Typically, you use a cloned solution to ship a major update to the preceding solution.

Create a Segmented Solution

To create a segmented solution, we need to create an unmanaged solution and then add the existing resources. You can add multiple system or custom entities, and for each entity, choose the assets you want to include in the solution.

The wizard-like setup takes you step-by-step through the process of adding entity assets.

Wizard will be opened for each entity that is being added to the solution.

In the below example I am adding Account, Case and Contact entities to the solution.

Then, select the solution components.

Follow the wizard. In Step 1, starting in alphabetical order, select the assets for the first entity, the Account entity, as shown here.

 

Select the assets you want to add into the solution. In my case I have selected Account Number field.

In Step 2, for the Case entity, add all assets.

In Step 3, add the Anniversary field for the Contact entity.

So now we have created a segmented solution which contains three entities Account, Case and Contact with just the selected assets.

Creating a Solution Patch

A patch contains changes to the parent solution, such as adding or editing components and assets. You don’t have to include the parent’s components unless you plan to edit them.

In the Solution page we have a new button “Clone a Patch”. Select an Unmanaged solution and click the “Clone a Patch” button.

A Clone To Patch dialog box appears with version number and an option to modify the Minor version number.

The following screenshot shows the base solution “SegmentedSolutionExample”, version “1.0.1.0” and the Patch “SegmentedSolutionExample_Patch”, version “1.0.2.0”.

In the patch we added a new custom entity called “Book”, and included all assets of the “Book” entity in the patch.

 

Cloning a Solution

When you clone an unmanaged solution, all patches related to this solution are rolled up into the newly-created version of the original solution.

Again navigate to the Solutions List and select an unmanaged solution that we want to clone and click “Clone Solution

A dialog box will appear with Version number and an option to edit the version number.

The new solution will contain three original entities and the custom entity called “Book” that was added in the patch solution. Also the entities will contain only the assets that we selected above.

 

The following two tabs change content below.
Murali Narayanan

Murali Narayanan

Ever changing hobbies ...but an undying passion for Dynamics CRM, Salesforce and all the new age technologies out there!
Murali Narayanan
Murali Narayanan

Ever changing hobbies ...but an undying passion for Dynamics CRM, Salesforce and all the new age technologies out there!

All stories by: Murali Narayanan