I recently had a requirement to perform some Data Migration, but I needed a test system while I built up my SSIS process as I didn’t want to use the real online environments. Luckily, I have my own on-premise Dynamics 365 Version 9 Server which I have always used for testing and messing around with solutions and compatibility.
The main issue I have always had with using on-premise servers however is that these days, we are all developing with online environments, and solutions and what not from online cannot be imported into an on-premise environment. In the past, I have often just resorted to hand modifying solutions to get them in to the system. This would often involve editing the solution.xml file within the solution zip file, to alter the version tags at the top, and to remove the crmonline tag. Quite often, this would also require a few modifications to the customizations.xml file to remove any tags that do not exist in version 9 of Dynamics.
Its a hack, but for testing purposes, this was always something that worked.
These days though, you more often than not will face all manor of other issues, such as dependencies on other solutions, and its become a lot harder to achieve this.
I have updated my extension to support publishing of files from Visual Studio to Microsoft Dynamics Portals.
The tool now supports publishing files to Web Templates and Web Files, allowing you to use Visual Studio to edit and track changes of your portal related files, and quickly update Dynamics with the appropriate Portal files.
Web Files and Web Templates are simply listed within the Web Resource linker dialog for you to select. You can then publish the appropriate files within your Visual Studio solution to Dynamics.
If you have installed the extension from the Marketplace, then it should prompt you to update, but if not, you can get it from the below link.
I have decided to release my Visual Studio Template for Microsoft Dynamics. This allows you to quickly create a Solution within Visual Studio that holds separate projects for keeping your assemblies, web resources and data organised.
Most CRM Developers either use, or have at least heard of CrmSvcUtil for generating early bound classes for developing code and using the resulting classes to manipulate CRM data. I personally do not like working with early bound entities as the resulting class files are huge, and I personally prefer working with the standard Entity Framework for creating and updating entities, and for Linq queries.
Often, I use some helper class libraries that I can use to represent the custom entity names and attributes, so that they can be referenced in code and provide a degree of separation from the actual Schema names and to make code easier to write, and support Intelli-sense.
Something like the code sample below:
public static class Contact
public static const string EntityName = "contact";
public static const string Name = "fullname";
This would then allow you to do the following:
public void createContact()
Entity contact = new Entity(Contact.EntityName);
contact[Contact.Name] = "Joe Blogs";
I was offered a suggestion by a fellow developer that wouldn’t it be good if my CRM Utilities for Visual Studio allowed you to generate this kind of Class file automatically. Well, I thought it was a brilliant idea, and so thanks to the wonderful gentleman of XRTSoft, here it is.
Its split into two options, one to generate classes for your Custom Entities, and one to do the Standard CRM entities.
The resulting file will look something like this:
Notice that for each Entity, it will add the Logical Name, Primary ID Attribute, and the Primary Name Attribute as standard, and then all of the attributes as well. It will also add sub classes for any Option Sets to allow you to reference specific Option Set Values without having to look them up in CRM.