We are living in the age of “apps”. A quick search on internet will show that there are close to 15,000 apps registered in Windows 8 marketplace while Android is sprinting ahead with approximately 600,000 aps and Apple will reach record 1 million anytime now. We have huge opportunity in this space.
The Microsoft Dynamics CRM is also evangelizing apps for Windows 8. As per official communication, the Windows 8 app for Dynamics CRM 2011 will be available by mid of 2013. In addition, you can also build your custom app which sources data from Dynamics CRM. I am sure you will come across business scenario (different looks and feel app, app leveraging old versions 3.0/4.0 CRM etc.) where you need to build custom Windows 8 apps for Dynamics CRM.
This article is focused to discuss approaches to integrate Dynamics CRM in Windows 8 apps and pros-cons associated with them.
If you try to use CRM SDK with Windows 8 app, you encounter loads of build errors because CRM SDK and Windows 8 app use two different platforms which are not compatible with each other. The CRM SDK classes are built with .Net Framework 4.0 as target while Windows 8 apps use “.NET for Windows Store Apps”. You find the same type of errors whether using early binding or late binding methods.
So, how do we build Windows 8 apps which can talk to Dynamics CRM? There are roughly three approaches which we can take – each with their set of pros and cons.
The Microsoft Dynamics Team has developed WinRt compatible CRM libraries (WinRt.Microsoft.Crm.Sdk.Proxy and WinRt.Microsoft.Xrm.Sdk) which you can use in Windows 8 app. Right now, the libraries are in pre-released state so you can download the code of the libraries along with a sample using them. I presume that the WinRt SDK will be officially released with the release Windows 8 client for Dynamics CRM. You can download WinRt compatible Libraries and sample from the following link –
The SDK is the way to go as it will be integral part of CRM release when it happens.
Works with CRM Online (Live and Office 365) , Claim Based and IFD deployment
Does not work with CRM on-premises deployments using Active Directory authentication. [at present]
It is currently in sample stage only.
Will not work with old versions of Dynamics CRM (4.0 and 3.0).
This is a simple approach which works with the current release of CRM SDK. It uses a WCF service as an intermediate service to normalize platform compatibility between CRM SDK and Windows 8 app. The following are the high level steps to use intermediate service –
Simple to use. Works with current release of CRM SDK.
Works with CRM Online (Live and Office 365), IFD deployment and On-Premise using Windows Authentication
Possible to make calls to old versions (3.0 and 4.0) of Dynamics CRM.
More development effort due to development of intermediate WCF method.
You have to plan for deployment of intermediate WCF service on some box. Overhead deployment task.
After the release of CRM SDK for Windows 8 App, this approach should not be used unless talking to old versions (3.0, 4.0) of Dynamics CRM.
This approach also uses current release of CRM SDK but works only with early binding method. In brief, you create proxy for CRM web service and then change proxy class code to make it compatible with Windows 8 apps. Here are the steps –
Note: Deleting these reference will have no negative impact on the functionality.
Simple to use. Use early binding and strong data types.
Can leverage Event-based Asynchronous Pattern (EAP) – async /await in Windows 8.
Lengthy clean-up task. If proxy is regenerated due to change in entity metadata then clean-up has to be performed each time.
Would recommend as intermediate approach till the CRM SDK for WinRt gets released.
Will not work with old versions of Dynamics CRM.
You have choices to use the approach you want. I would recommend using CRM SDK for WinRt when it is released. Till that happens, you can choose between approach 2 and 3. The approach 2 (Bridge Service) has advantage to work with old CRM versions as well. Hope you find this article useful.