Category Archives: Plugin

Working with JSON objects in Dynamics CRM Plugins

While working with Dynamics CRM plugin, we encountered a scenario where we were calling a Web API, which returns data in JSON format. Normally .NET framework provides many methods to use JSON in C# code, many third party solutions such as Newtonsoft.Json library are available. Mostly we use JavaScriptSerializer to read JSON data. However, when we register… Read More »

Change Createdby/Modifiedby Field at Runtime in Dynamics CRM Plugin

Recently we came across a scenario where we were assigning CreatedBy and ModifiedBy field of the record that was created by plugin dynamically based on the data of the record that was getting created by plugin. Let us say, my Contact entity that has field “new_createdby”, ”new_modifiedby” and its records are getting created by plugin.… Read More »

Use RetrieveDuplicateRequest in Dynamics CRM

Introduction: Recently we had a requirement where we had to create Contact records from data received from other System and if Duplicate record found then avoid creation of records based on Duplicate Detection rules specified in the System and get the List of the Duplicate Records found in the system. The Duplicate Detection rules might… Read More »

ExecuteMultiple & Workflow or Plugin Assemblies

Introduction: ExecuteMultipleRequest – Message that allows you to club multiple CRM operations and execute them at one go without having to send each of these as separate requests. The ExecuteMultiple provides you with the option to indicate whether you want to continue processing the remaining requests if one of them fails or to stop processing. But… Read More »

Price List selection logic available starting Dynamics CRM 2015 Update 1

Introduction Traditionally Price List in any of the transactions like Opportunities, Quote, Orders or Invoices was set by reading it from Customer. If there was no price list set for the customer, it would be left blank and the user would be required to set it manually. Price List is critical and needs to be… Read More »

Querying More than 5000 records in Dynamics CRM

Introduction: There are multiple ways provided in Dynamics CRM SDK to query and read data like Using ODATA Using FetchXML Using Query object ODATA has a limitation where it can return only 50 records at a time. You can ofcourse query more than that but it would be in batches of 50 records at a… Read More »

Plug-in Tracing in Dynamics CRM 2015 Update 1

Before CRM 2015 SP1 update, an alternative option to debug the Plug-in or Workflow for developers was to use tracing messages which would help to trace the program using custom messages. The developer had to manually throw an exception in order to trace the program. And then when the plug in/workflow is triggered a dialog is… Read More »

Use Tracing in CRM 2011 Plugins

CRM SDK provides way for you to include the debug details about your plug-in in case you need to trace the plug-in execution. For this you will have to initialize the “ITracingService”. The service provides way to trace the details and display it whenever plug-in fails and throws an exception. //Initialize the serviceITracingService tracingService =… Read More »