Accessing Context data in Silverlight CRM Web Resources

Silverlight Web Resources typically provide some interaction with contextual data in Microsoft Dynamics CRM, you should plan how you create your Web resources.

If the .xap webresource is running from within a form in CRM, the object  Xrm.Page.context can access contextual information in the same way it can in an entity form.

When you add a Silverlight Web resource to a form , in the dialog window that opens , there would be a checkbox – “Pass record object-type code and unique identifier as parameters option” . Have this option checked, the web resource published before you could retrieve information listed below. You also have the option to enter text as a custom parameter in this window.

You can get the CRM value like this :

string entityTypeName = App.Current.Host.InitParams["typename"];

Similarly other parameters which you could retrieve are :

id – The unique identifier of the record.

type – The entity type code. For custom entities this can vary between organizations.

typename – The logical name of the entity.

orgname – The name of the organization.

userlcid – The language code representing the user’s language preference.

orglcid – The language code representing the organization’s base language.

data – The value of the text entered as a custom parameter.

Hope this information is helpful ! 🙂

About mytechlifedays

Its been a wonderful learning period over the last 6 years in the IT industry , getting exposed to whole lot of technologies and ideas. The hurdles and the crisis that came along have been wonderful experience ... And now its time to pen them down so that let some others execute faster and easily with these information .....
This entry was posted in MS CRM, Silverlight and tagged , . Bookmark the permalink.

Leave a Reply ! It would be always appreciated ! :)

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s