locked
CRM 2011 Rollup 12 issue: Unable to cast type 'System.String' to 'System.Windows.Browser.ScriptObject' when calling HtmlPage.Window.Invoke from Silverlight RRS feed

  • Question

  • Code Line:
    //invoke dialog from Silverlight
    ScriptObject result = (ScriptObject)HtmlPage.Window.Invoke("showModalDialog", url, args, features);

    Issue:
    Whenever above line of code executed from Silverlight control code in CRM Online O365 with UR12, it throws error
    "Unable to cast type 'System.String' to 'System.Windows.Browser.ScriptObject'".
    Same code is working in On Premise (with UR11) & earlier CRM Online (with UR11)

    Root Cause:
    Before UR12 (Polaris) update, return type of "HtmlPage.Window.Invoke("showModalDialog", url, args, features)" was ScriptObject but now UR12 returns it as "String" (JSON string).

    Resolution: We have currently resolved this by adding switch case and converting Json string to object.

    Question:
    Does anyone faced this issue? Is it change Microsoft come up with in UR12 (if documented)? Or it's a bug?


    Tuesday, January 29, 2013 9:17 AM

Answers

All replies