Dynamics CRM 4 with Silverlight Part 1 – The IFRAME approach.

Introduction

29/72010: Sorry but I am going to be dropping this series because my software focus has change to developing Windows Phone 7 applications. Maybe re visit this in the future (hopefully before CRM 5 is released

Hi, this is part 1 of a series of posts giving an introduction to extending Microsoft Dynamics using Silverlight.

In this post I will outline how to add a custom Silverlight control to any of the entity forms.

For these articles I will be using Visual Studio 2010 Professional with All of the usual Silverlight (version 4) tools installed.

At Sequence the company where I work we make use of the eService accelerator this allows our customers to log cases via an extension to our web site. For this series of posts I am going to create a new tab in the contact entity screen that will display details of the contacts log in details that are stored in a separate ASP.NET authentication database.

How it works

The CRM 4 entity forms allow administrators to customise forms in many different ways but the one way that makes things handy for us is the ability to add IFRAME elements into a form. We will use this customisation to display a Silverlight control inside the form.

Getting Started

Create a new Silverlight application as normal ensuring that you enable RIA services and create a test web project.

NOTE: In future when you will want to make this live you will need a server available that you can add the .Net framework 4 and host the web site or virtual directory.

Identifying the Entity

So that the Silverlight application knows what entity it is using it will need to be passed the Id of the entity that is being displayed in the entity form. To ensure that this works when you add an IFRAME customisation to an entity you will need to ensure that the I frame is passed the record ID and type:

It does appear that this is my most popular post so far so I will add a supplementary post in the next couple of days. By authentication I am referring to the management of the data within the eService portal. We used this and a Silverlight app to manage users (when they forget passwords, need removing etc).

You could always create a WCF service, RIA Service or WCF Data Service that exposes the stored procs within the asp.net authentication database by making use of LINQ to SQL or the entity framework.
You will have to make sure that the database that the authentication services use is pointing at the database that the eService portal is using.