Handling PATCH updates in a Web API service

I was working on a project where my client wanted a Web API service so various external portals could add and update members in CRM. Doing this I came across a problem called PATCH.

In the REST world it is very common to update items by only sending the changed data and leaving out the other variables. Let's imagine a "contact" entity where I only want to update the first name and leave the last name unchanged.


Get the text from a CRM option list through it's value

When you retrieve a record from CRM and one of the fields is a so called option set you might have noticed that only the numeric value is available.

With lookup fields (entity references) you can get the Id and Name directly but with option sets that doesn't work. I've seen lots of ways to retrieve the text via a value but this one I wanted to share with you because it is simple and straight forward.


Options added via addOption() appear in the list but cannot be selected

Today I was trying to solve a little mystery for a colleague of mine. She was trying to dynamically add options to an empty option list in CRM 2015. The following code was used to do so:

function OnLoad() {

    Xrm.Page.getControl("new_optionset").addOption({ text: "One", value: 1 });
    Xrm.Page.getControl("new_optionset").addOption({ text: "Two", value: 2 });
    Xrm.Page.getControl("new_optionset").addOption({ text: "Three", value: 3 });
    Xrm.Page.getControl("new_optionset").addOption({ text: "Four", value: 4 });

    Xrm.Page.getAttribute("new_optionset").addOnChange(function () {


Check out the new SDK features in CRM 2015

In CRM 2015 there are a number of nice new features I wanted to point out to you..

First of all there is the possibility to execute multiple requests in one go in such a way that if one of them returns an error none of them will be executed. This is somewhat similar to a database transaction..

Second one is that we now have an entity that stores tracing information. If you want to write errors and debug info from plugins and such you can now see them via the CRM interface in stead of viewing them on the server in some text file, which would not even be possible in a cloud version.


CRM dates one day too early when accessing them via LINQ

For one of my a clients I had to make something to import records from their old invoicing system into the new CRM via csv files. When this was completed it had to export result data they would use to check if all the data was transferred correctly. Because they had to "practice" this import many times I decided to make a Windows Forms application and access the CRM data via the API using LINQ.


Custom driver to access CRM data via LINQPad available again

When the custom driver made by Alex Igrushkin stopped working for CRM 2013 and 2015 and it appeared that there wouldn't be any upgrade as well, I was very disappointed. As a CRM developer I use a lot of LINQ queries and I loved to be able to execute and debug these queries in LINQPad before building and publishing plugins and such.

Today I discovered this MSDN post where Kenichiro Nakamura anouched he and his team released a new driver called "LINQPad 4 Driver for Dynamics CRM"


CRM Solution Manager - A must have tool for CRM developers

When I started as a CRM developer I used to make changes to JavaScript, went to the form editor of the entity concerned, clicked form properties, opened up the JavaScript, pasted the changed code, clicked save and publish and the went back to my browser to refresh the page and see if the change was working.

You can imagine that if you keep doing this months on end you will get RSI for sure!


Latest CRM 2015 Update 1 not coming to CRM on-premise just now

Some of my clients are a little disappointed with the slow rendering time of the more complex forms in CRM 2013 and 2015. Especially when there is a lot of custom JavaScript it takes rather long until the user is able to edit the data. Many times we compared the results of an empty installation with their customized installation and proved that the customizations weren't slowing things down that much.