Thursday, October 31, 2013

Microsoft CRM 2013: Adding standard Bing Map control to forms of custom entities

In CRM 2013 Microsoft released really great feature – OOB integration with BingMaps. Unfortunately list of entities that support BingMaps control is limited to Account, Contact, Lead, Quote, Order, Invoice, Competitor and System User.
I did small investigation how this control is organized and I can confirm that it is possible to add OOB Bing Maps control to forms of custom entities. But be careful -  provided solution is 100% unsupported but doesn’t require any knowledge of development, JavaScript, HTML and so on.

Actions: usage of input/output arguments in plugins that handle Actions

Main message is that input/output arguments are available in InputParameters/OutputParameters collections of PluginExecutionContext.

Usage of Input argument
Following code shows how to check that Input Argument was passed and get value:

if (localContext.PluginExecutionContext.InputParameters.Contains("ArgumentName"))
    string stringInputArgument = (string)localContext.PluginExecutionContext.InputParameters["ArgumentName"];
    //Your code for case when Argument was not passed

Usage of Output argument
Following code shows how to set Output argument:

localContext.PluginExecutionContext.OutputParameters["OutputArgumentName"] = <Value>;

One thing you should remember is that step that handles your action and sets Output arguments had to be registered on Post Operation (40).

For those who use CRM Developer Toolkit – registration of new plugin, registration of your step in code of your plugin and part of RegisterFile.crmregister file:

base.RegisteredEvents.Add(new Tuple<int, string, string, Action<LocalPluginContext>>(40, 
    "MessageName", null, new Action<LocalPluginContext>(PluginClass)));

<Step CustomConfiguration="" Name="StepName" Description="Description" Id="024c3b93-6041-e311-ad38-6c3be5a8d218" 
    MessageName="MessageName" Mode="Synchronous" PrimaryEntityName="none" Rank="1" SecureConfiguration="" 
    Stage="PostOutsideTransaction" SupportedDeployment="ServerOnly">

For those who use PluginRegistration tool:

Monday, October 28, 2013

Actions, input parameters and “Object reference not set to an instance of an object” exception

During playing with Actions I wrote simple .Net code that invoked execution of an Action:
slick_CustomActionsTestRequest request = new slick_CustomActionsTestRequest()
    BoolInArgument = true,
    DateTimeInArgument = DateTime.Now,
    DecimalInArgument = decimal.Zero

slick_CustomActionsTestResponse response = service.Execute(request) as slick_CustomActionsTestResponse;

During testing I have got really weird and unclear error – “Object reference not set to an instance of an object.”:

Sunday, October 27, 2013

CRM Developer Toolkit for Microsoft Dynamics CRM 2013 - Visual Studio 2012 Crashing

After CRM 2013 was released I decided to install CRM Develoepr toolkit for CRM 2013 on my workstation. After I tried to create CRM Package solution I have got following error and VS crashed and restarted:

Microsoft Dynamics CRM 2013: Actions: deployment of plugins through CRM Developer Toolkit

I played with new version of CRM Developer Toolkit and was not able to find a way to register plugin that handles action using UI. Following post describes workaround how make it possible.

Microsoft Dynamics CRM 2013: Actions walkthrough for .Net and JavaScript developers

I believe that almost every developer for Dynamics CRM faced with scenario when he/she had to invoke some complex logic on a server side, pass parameters and receive a response back. Before CRM 2013 we used workarounds similar to this one. Once Dynamics CRM 2013 was released we have got solution that would not require ‘magic’.

Saturday, October 12, 2013

How to turn on Duplicate Detection for client side in Microsoft Dynamics CRM 2013

Microsoft decided to remove Duplicate Detection feature in 2013 version. Why? Not sure.
Following article describes how to restore this functionality.

Saturday, October 05, 2013

Microsoft Dynamics CRM 2013 is now available online

Steps to get:

1. Open following link -
2. Click Try it free button.
3. Choose India as a country.
4. Process all required steps.
5. At the end you will get instance of CRM 2013 Online.