locked
CRM 2011: HTML web resource consuming Silverlight web resource RRS feed

Answers

All replies

  • Now when I have removed script element to include Silverlight.js. And now when I click Preview button to preview the HTML web resource, it does not prompt any errors but it shows a blank page. No data grid is visible.

     


    Ajay Chawla
    Friday, July 29, 2011 1:55 PM
  • Hi Ajay,

    Try to debug your SilverLight code.

     


    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html
    Friday, July 29, 2011 2:43 PM
  • Ajay,

    Open Visual Studio and attach debugger to the IE process. Put a breakpoint at the very beginning of you SL application and see if the SL code gets invoked. If your breakpoint is hit, you can step through the code.

     

    Friday, July 29, 2011 3:24 PM
  • How could I insert a breakpoint when I am suppose to upload my application.xap file to CRM? I tried with throwing an object of Exception manually in OnLoad event and then tried to attach the preview IE process with the debugger. But the exception is not thrown.

    Rather when I insert this silverlight web resource in the opportunity form. The form does throw an exception. Also please note that Silverlight application works great (when i dont manually throw an exception) in the opportunity form.

    Thanks


    Ajay Chawla
    Monday, August 1, 2011 5:34 AM
  • Reference link: http://msdn.microsoft.com/en-us/library/gg328358.aspx

    As per this reference link, I have done below stuff.

    1. Uploaded SilverlightApp.xap file to a web resource of type silverlight

    2. Created a HTML web resource (named as new_SLHostPage) to host the SilverlightApp.xap (referenced using $webresource directive)

    3. Created a javascript function which has

           window.open("new_SLHostPage");

    4. Configured the onchange event of Subject line to call javascript written in step 3.

    But When I change the subject line and hit tab button, the CRM opens a new window and CRM THROWS AN ERROR SAYING:

    An error has occured. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization's Microsoft Dynamics CRM Administrator.

    The new window launched has a URL as

    http://crmserver/_common/error/errorhandler.aspx?BackUri=&ErrorCode=&Parm0=%0d%0a%0d%0aError%20Details%3a%20A%20potentially%20dangerous%20Request.Path%20value%20was%20detected%20from%20the%20client%20%28%3a%29.&RequestUri=%2fOrg_name%2fuserdefined%2f%24webresource%3anew_SilverlightHostPage%2fdefault.aspx

    Thanks


    Ajay Chawla
    • Edited by Ajay Chawla Monday, August 1, 2011 6:47 AM explained fully now
    Monday, August 1, 2011 6:45 AM
    • Marked as answer by Ajay Chawla Monday, August 1, 2011 11:33 AM
    Monday, August 1, 2011 11:33 AM
  • Hi Ajay,

    This is the procedure to follow to open a Silverlight application by clicking a custom button in the ribbon menu.

    1. Add the button, in the custom action put this code: <CommandDefinition Id="AnId">
                        <EnableRules></EnableRules>
                        <DisplayRules></DisplayRules>
                        <Actions>
                          <Url Address="$webresource:new_/SilverlightFromRibbonTestPage.html" PassParams="true"></Url>
                      </Actions>
                      </CommandDefinition>
    2. Create two web resources one for the xap and one for the html. Call the Silverlight webresource this way: new_/ClientBin/SilverlightFromRibbon.xap, and your html this way: new_/SilverlightFromRibbonTestPage.html.

    Step 1, 3a and 3b that you did are not needed.

    Soon I will upload a full working example on my blog: http://lucianodangelo.blogspot.com/

    I hope this help.

    Cheers, Luciano.

    Thursday, August 11, 2011 4:57 PM