Technical CRM 2011: Silverlight access to fields on a form
But one common request I have seen that wasn’t that straight forward was how to access fields on the CRM form that you launched your SL from.
There are 2 techniques that when used together make this a simple process:
Silverlight’s built in helper class HtmlPage.Window.Eval
CRM’s Client side SDK
Below is a sample Silverlight method that takes in a field name and returns
value of Lookup on the CRM Form.
String GetLookupAsString(String lookupName)
String field = System.Windows.Browser.HtmlPage.Window.Eval(“window.opener.Xrm.Page.getAttribute(‘”
+ lookupName + “‘).getValue().name”).ToString();
Using this pattern you should be able to interact with CRM forms from Silver Light to your heart’s content!
More places to learn about Silver Light with CRM 2011: