CRM and Silverlight Integration

As many of you may be aware, there is a lot of buzz around Microsoft Silverlight. For those that are unfamiliar with it I invite you to check its web site and play with it, it is really powerful.

The potential of Silverlight goes beyond simple animations. The object model under the covers allows you to wire Silverlight with pretty much any application, especially one that is designed from ground up to be extensible, such as Microsoft Dynamics CRM J

I developed the application provided as part of this post to be presented at TechEd a couple of weeks ago by Michael Lu, a colleague Program Manager (actually my office mate). Based on the feedback received I decided to go ahead and post the source and explain it a bit. The demo illustrates how CRM customizers can wire up CRM with Silverlight.

What the demo does

It displays the pictures of an Author along with his/her related books in a nice little animation. You can drag and drop the pictures to the right to get more detail about the object being dragged. The information, as explained below, is pulled from CRM records.

Please note that the purpose of the demo is not to provide production quality code but to spark curiosity around the numerous scenarios that can be enabled by providing rich visualization capabilities within CRM using Silverlight. Download it, play with it and I’m sure you will almost immediately start thinking about tons of scenarios that you can achieve using both technologies. J

The components of the demo application are as follow:


Silverlight is based on Windows Presentation Foundation (WPF) which means that graphics and animations of the demo are defined in the Extensible Application Markup Language (XAML); you can use a WPF editor such as Microsoft Expression Blend 2 to change it; the latest Blend preview supports Silverlight 1.0 and 1.1 Applications


I used Silverlight 1.0 which means that I didn’t dig into managed code (Silverlight 1.1 also supports managed code). All the logic is written in JavaScript using the provided Silverlight object model as well as event handlers. I might update the demo to use managed code in the future.

Dynamics CRM integration

Those who have experience working with CRM know that there are many extension points where third party applications can plug-in. All the techniques described in this post (Forms and FetchXml) that deal with CRM are documented in the CRM SDK.

The control that hosts the SilverLight Application is an IFrame inside a CRM Form of a Custom Entity. Since the logic is written in JavaScript I used two approaches to pull data from CRM:

· The first one was to pull data directly available on the Form using the CRM Form object model (crmForm).

· The second approach was to use XMLHttpRequest (AJAX although I didn’t used asynchronous calls) along with CRM FetchXML to interact with CRM webservices.


The file contains all the necessary files to install the demo including the customization files for the entities used. The readme.txt contains detailed instructions on how to install the demo app.

I would love to hear if any of our readers has good examples of CRM-Silverlight integration J


Humberto Lezama Guadarrama

Comments (14)

  1. Now this is really cool! I have to find some time in my schedule to play with this 🙂

  2. farnsworth says:

    Awesome stuff thanks for posting it — I reposted this on <a href="; target="_blank">Silverlight Saber</a>; I hope that’s okay.

  3. Chris Moreton says:

    Followed the install instructions exactly. I added some Authors and Books but the Authors Iframe displays nothing other then the "reload" button – the nice graphics I was expecting don’t appear. Other Silverlight apps work on my PC. Any ideas why this isn’t working for me ?

    Thanks, Chris

  4. Humberto Lezama says:


    A couple of things may be happening:

    1.- Did you change the URL of the server on the “Scene.xaml.js” (step 2 of readme.txt)?   That is the only reason I see that may cause a silent problem as the one you described.

    Please note that although readme.txt says “http://yourserver:5555” your CRM server may actually be running in a different port (80 maybe? )

    2.-  The image URLs that you input in authors and books may be invalid; have you tried the ones supplied with the demo?  (“book.jpg” and “author.jpg”)

    Hope this helps

  5. kitty74jh says:

    I can’t image that our crm can integrate with silvelight~~ Oh, that’s so exciting!

  6. Martin says:


    I have the same problem as Chris. URLs and port are OK. But for some reason the onLoaded function is not called at all (I added an alert at the start of it, and it never shows up).

    Calling the default page through file system works fine, but when I try to open it through localhost it does not load.

  7. Humberto Lezama says:

    Try adding the CRM site to your "trusted" sites. I remember having a similar problem (the silverlight app not loading) because of security restrictions.  It is weird though because if your are accessing it (for testing purposed) using http://localhost:5555/… security shouldn’t be a problem.

  8. Martin says:

    Thanks for the reply. My CRM was allready in Trusted Sites.

    I can’t call it through http://localhost, but if I double click the html file it opens with Silverlight content.

  9. Mario Raunig says:

    sounds like a nice example. i got the same problem though. site is in trusted sites, i also tried intranet zone, but i just get the "get silverlight" download and refresh buttons although silverlight is installed.

    Any ideas?

  10. I posted a couple of month back a sample that illustrates integration between dynamics CRM (3.0) and

  11. I posted a couple of month back a sample that illustrates integration between dynamics CRM (3.0) and

  12. Ari says:

    I can’t import the customisation file because the laguage is english. is there a dutch version available ? thanks

  13. Help says:

    The link doesn't work, I can't download the demo!

Skip to main content