locked
CRM2011: Is there any difference between manually refresh form and reload form after save? RRS feed

  • Question

  • It's really strange issue.

    I have a silverlight webresource on the form, in the form onload event, I use javascript to call the method in the silverlight.

    When open a form or click refresh the form, the silverlight method be fired which is correct.

    But if update the record and click save, the form reload but the silverlight not fired, I got this javascript error:

    Microsoft JScript runtime error:

    SCRIPT16389


    This is my javascript function to call silverlight:

    function Test() {
        debugger;
        var sl1 = document.getElementById('WebResource_SLTextBox'); //the weresource was put on the form already
        sl1.Content.scriptableLable.TestAlert(); //the silverlight only do one thing which is pop up a message box. here got javascript error

    }

    ---------------

    Update:

    I add a javascript alert for test purpose and it make it works! After click the "OK" button on the alert box, the silverlight method fired.

    The problem is I can't leave this alert on the page. It only for testing, but if I remove the alert, the silverlight not fired. :(

    • Edited by nixjojo Thursday, February 23, 2012 9:06 AM update
    Thursday, February 23, 2012 7:14 AM

Answers

  • I modify my code, call the silverlight method in silverlight control loaded event instead of call it from form onload javascript.

    This way worked.

    • Marked as answer by nixjojo Friday, February 24, 2012 3:46 AM
    Friday, February 24, 2012 3:46 AM

All replies

  • It genreally happen if the element is hidden.


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Amreek Singh Senior CRM Consultant CDC Praxa Sydney, Australia http://mscrmshop.blogspot.com http://crm2011usersettings.codeplex.com

    Thursday, February 23, 2012 7:28 AM
  • You mean the webresource? It's not hidden.

    var sl1 = document.getElementById('WebResource_SLTextBox'); // Here already get the sl1

    Thursday, February 23, 2012 7:33 AM
  • I modify my code, call the silverlight method in silverlight control loaded event instead of call it from form onload javascript.

    This way worked.

    • Marked as answer by nixjojo Friday, February 24, 2012 3:46 AM
    Friday, February 24, 2012 3:46 AM