Microsoft Dynamics CRM 2011 – Improving the Development Experience

Roshan Mehta, 13 January 2011

The development experience is yet another improvement when upgrading your Dynamics CRM 4.0 implementation to Dynamics CRM 2011. Dynamics CRM 4.0 uses many “CRM specific” data types which can take a little while to get used to but can still allow you to gain the desired result with any custom programming.

Microsoft Dynamics CRM 2011 – Improving the Development Experience*

The normal CRM data types such as CrmNumber, CrmMoney, and CrmBoolean (along with the others) have been “sent to the recycling bin” and are replaced with the use of native .NET data types in CRM 2011. This speeds up the training time required for new developers working with CRM, since they will already be familiar with .NET data types. Faster training along with rapid development leads to a shorter project lifecycle, and ultimately what CRM is all about – happy customers!

Another improvement is the use of LINQ programming within the raw SDK. Dynamics CRM 4.0 requires the use of many different objects in order to perform simple tasks such as retrieving a single record from the CRM database. I personally found that the use of these different types of objects took a while for me to get my head around and were somewhat confusing at first. What would normally take you about twenty to thirty lines of coding will now only take around five lines thanks to the new LINQ to CRM libraries provided in CRM 2011. For example, once the data context is set up, you can retrieve a list of all Account records in your CRM system, with the following code:

            var accounts = (from a in ctx.accounts
                            select a).ToList();

LINQ programming is extremely powerful and allows you to perform join queries, retrieve only certain fields from CRM, specify the field to sort by and in what order, and also group by a specific field. Now there is no need to use QueryExpression, FilterExpression or ConditionExpression in your CRM queries!

This was just a small introduction to the new features available in the programming side of Dynamics CRM 2011. In the future, we will provide coding examples on how to work with CRM data in a number of different ways. The design of CRM 2011 now allows easier integration with other systems in the Microsoft Office Suite, as well as other third-party applications using custom programming. I look forward to putting the new SDK to practise by building custom plug-ins and workflow activities for CRM 2011.

* Image from http://www.ibidred.com/coding/