When I first started looking more closely at some of the new features within Dynamics CRM 2016, my initial thoughts was this was that this was a release for the fans (i.e. CRM Administrators, Customisers & Developers). Putting aside some of the big headline grabbing features such as the Interactive Service Hub and Word Templates, there looks to be a lot of subtle changes underneath the hood which those who work with CRM on a daily basis will be jumping for joy at.
One of the fundamental concepts that needs to be grasped as part of any CRM development work is Solutions. This includes understanding the differences between managed/unmanaged solution files, how to export/import solutions between different environments and how managed/unmanaged customisations are handled by CRM. There are many debates and discussions online regarding the subject, but the general rule of thumb is to use unmanaged solutions for the majority of your customisations, and only use managed solutions for when you are an ISV developing a bespoke solution to performs a specific function and/or links in with a separate application.
One of my personal bugbears regarding Solutions is the time and effort involved as part of doing an update. If, for example, you have just one Solution file for your entire businesses CRM customisations, then over time pushing out a solution update into your Production environment can take up to 30 minutes or more to complete - even if your update only contains, for example, a field name change! This can make pushing out hot-fixes or urgent updates more time-consuming and lead to delays in addressing problems within a live production system.
Whilst doing some digging around within CRM 2016, I was very excited to see the following 2 new buttons on the Solutions page:
Could it be that we now have a better and more efficient way of pushing out small parts of our CRM customisations and urgent hot-fixes? Before we take a look at how these buttons work in practice, it is useful to first explain what each one does in more detail:
Clone a Patch
Clone a Patch creates a patch of your main solution, which can contain a selection of CRM customisations that you wish to export from the system. A solution can have multiple patch solutions. One thing to point out is that you must manually add the components you wish to include as part of your patch solution into the Patch solution file. When, for example, you add in the Entity which you wish to include in the patch, you can specify individual entity forms, views, charts etc. that you want to include, something which I really like:
Whilst there is at least one patch of a solution present in your CRM system, you will not be able to edit the main solution file. CRM presents you with a yellow banner message to inform you of this when you enter the CRM Solution in question:
In order for the solution to become available for customisation again, you will need to either a) delete all patch solution files that derive from the main solution or b) use the Clone Solution button, which will be explained in more detail next.
Clone Solution enables you to quickly combine together a solution and all of its descendant patches back into one solution file. Say for example, you have 1 Main Solution file and 3 Patch Solutions from the Main Solution. Clicking the Clone Solution button will combine all of these together again as part of 1 solution file. As a result, this will then allow you to customise the main solution file again without any issues.
So how does this work in practice then? Let’s find out:
To start of with, here is a custom entity within a new solution file. Nothing has been customised for this entity at this stage:
This is then exported out of the system as a solution file and imported into our target environment. Next, let’s say we want to add a newly created field to our entity as well as making some other changes as well within the main solution. These are in an incomplete stage, so therefore we just want to export our new field only as a patch solution for now.
On the Solutions page, we select our Main solution file and press the Clone a Patch button. We are greeted with a screen similar to the below where we can specify a few optional details, before then confirming:
Next, we then have to go into our Patch Solution and add in the elements that we wish to push out as part of a patch. In this case, we want to add a new field to our Test Entity. We therefore go into a Patch Solution file and go to Add Existing… in order to add in our Test Entity. You will be greeted with the Entity Assets window above and, in this example, we want to include all assets so we just press Finish to add this in.
Now we want to add in our new field:
As above, this is then imported into our target CRM environment, as you would do normally for any other solution file. It even looks the same!
Now, lets say we want to pull together all of our other changes as part of a traditional solution update. We also want to rename our Testing Field as follows:
We select our Solution file and click on the Clone Solution button. At this stage, we can modify the display name of the Solution and also specify a new version:
When we click Save, the patch solution file will vanish from our solution file, replaced by our one solution file which can now be edited and exported accordingly.
And that’s it! It takes a while to get your head around, particularly if you have been used to working with Solutions in previous versions of CRM, and I think it will take a while before this starts to become widely used (to be honest, I have not yet used it as part of some of the recent solution updates I have had to do 😳). Still, it is good to know that for those who are just coming into CRM Administration/Development, you can get to grips with this feature straight away without having to concern yourself too greatly with the “old” method. Just don’t be surprised if you hear from CRM veterans something like “Back in my day, we just had Solution updates - and we were lucky to have them!”
Let me know in the comments below if you have started to use Solution Patches yourself within your CRM 2016 environment.