Tuesday, 15 March 2016

Automating Third Party Assembly Merging in Visual Studio For Dynamics CRM Online Plugin With MSBuild.ILMerge.Task

In Dynamics CRM plug-ins we often require to use third party assemblies. But since we do not have access to server for Dynamics CRM online we cannot register assemblies in GAC which can be referenced from Dynaics CRM plug-in.

To resolve this issue we use the ILMerge for combining the dependent assemblies in our Dynamics CRM plug-in. ILmerge is a command line tool which is capable of merging assemblies together in a single assembly.

This manual task of merging assemblies in a single assembly can be automated by configuring post-build event of Visual Studio but there is even a simpler method for merging.

Install the MSBuild.ILMerge.Task from NuGet Package Manager Console in Visual Studio.

This will  add few files in Visual Studio Project as highlighted below.

On Installation of MSBuild.ILMerge.Task it also downloads ILMerge from NuGet and configures  package.config file so no separate installation is required for ILMerge.

Now you are ready to merge the assemblies, just compile the project and see the merged single assembly in bin folder.

If you needed further control over merged assemblies then you can configure ILMerge.prop


Monday, 14 March 2016

Decoding Dynamics CRM URLs and Analyzing QueryString Parameters.

Sometimes it is needed to understand what are the query string parameters passed in a Dynamics CRM url, It can be form url, view url, report url or any valid url.
Understanding of url query string parameters can be tedious when there are multiple encoded parameters.
This can be quickly analyzed by using Url QueryString Analyzer as explained below.
  1. Go to http://msxrmtools.com/home/UrlAnalyzer.
  2. Open Url QueryString Analyzer.
  3. Paste your Dynamics CRM url in TextArea box which you want to analyze. 
  4. Click Analyze button.
  5. Now you will be able to see results well structured in form of table.

JavaScript Intellisense in Microsoft Visual Studio for Microsoft Dynamics CRM 2016

Intellisense in Microsoft Visual Studio is great feature to speedup development as it can suggests the method name, parameters, data type and hint about the method functionality and parameters use. With Intellisense we don't have to lookup in the documentation and is great time saver for the developers.
MSXRMTOOLS.Xrm.Page.2016.js provides similar capability in JavaScript for Microsoft Dynamics CRM 2016.
MSXRMTOOLS.Xrm.Page.2016.js provides following benefits for the Dynamics CRM developers:
  1. Complete methods coverage available in Dynamics CRM 2016.
  2. Suggestions for methods available in Xrm.Page namespace so that developers don't have to look up in SDK for available methods in Dynamics CRM 2016.
  3. Hint about the methods functionality available  while typing.
  4. Hint about each of the input parameters i.e. the intended purpose of each  of the parameter while typing.
  5. Shows the data type of input parameters and output value.
  6. Hint about the possible input values wherever possible while typing.
  7. Hints are same as documented in Microsoft Dynamics CRM 2016 SDK. So that developers can easily identify and correlate.
Steps for using MSXRMTOOLS.Xrm.Page.2016.js JavaScript library for Microsoft Dynamics CRM 2016 development.
  1. Drag MSXRMTOOLS.Xrm.Page.2016.js file to your .js file in your Visual Studio project. It will add a reference to MSXRMTOOLS.Xrm.Page.2016.js  in your .js file. 
  2. Now start typing Xrm. and you will see the Visual Studio intellisense suggesting the methods for Microsoft Dynamics CRM 2016 JavaScript development.

Quickly Testing Dynamics CRM FetchXML Online

If you are new to Dynamics CRM then it can be difficult for you to test the FetchXML.

With MSXRMTOOLS.com you can easily test your FetchXML online without importing any solution in your Dynamics CRM organization or without downloading any tool.

Steps for testing FetchXML:

  1. Go to MSXRMTOOLS.com 
  2. Click on FetchXML Tester
  3. In the Dialog type your Dynamics CRM Online connection details:
  4. Click Login to...
  5. A new window will be opened, allow pop up if blocked.
  6. In text box paste your FetchXML query. like below
  7. Click Execute FetchXML button.
  8. You should see results like below:
  9. Try another query!