locked
Script error in Outlook Client (Office 2007) RRS feed

  • Question

  • Hi All!

    I have some custom aspx-pages displayed in SiteMap (Dashboard, product custom configuring). When one of these pages is opened for browsing in MS CRM Outlook Client it is imposible to open without error any crm-relative window such as: advanced find, help, system options, new record/activity. Script error:

    An error has occured in the script on this page.

    Line: 1

    Char: 46 (for some pages it is 1)

    Error: Object expected

    Code: 0

    URL: Custom page URL

     

    If doing this from web-client it works fine.

    Any help would be appreciated.

     

    Oleksandr Klymenko

    Monday, May 31, 2010 11:14 AM

Answers

  • Hello guys again,

    I got a solution, although it's not the most elegant, your customer will be happier :)

    When you click the "Advanced Find", "Help",..., buttons, you can debug the scripting error, find out the function to be called and overwrite it from your custom page.

    For example, for the "Advanced Find" button, this is the code you can find behind:

     try { top.stage.openAdvFind(); } catch (e) { openStdWin("/WealthDev/AdvancedFind/AdvFind.aspx", "Search", 700, 600); }

    The error is raised when "openAdvFind" is called, so from your custom page you can do something like this:

    <html>
    <head>
    </head>
    <body>
     <script language="javascript">
    	 top.stage.openAdvFind = function()
    	 {
    			openStdWin("/MyOrganisation/AdvancedFind/AdvFind.aspx", "Search", 700, 600); 
    	 }
     </script>
    </body>
    </html>
    

    if you have multi-organisations, you can replace "MyOrganisation" for a variable, whose value will be achieved from the parameter "orgname" in the QueryString of the URL (remember to enable the "PassParams" attribute for this SiteMap element).

    I hope this help.


    Software Engineer / Microsoft CRM Consultant Alfapeople UK (London)
    Tuesday, November 2, 2010 6:31 PM

All replies

  • what roll up is installed in CRM server and client side? you can check this article on how to find http://mayankp.wordpress.com/2010/04/13/check-dynamics-crm-version/ crm version. if both are different then I sugeest first make it same and see if this fixes this issue.

    Monday, May 31, 2010 11:31 AM
  • UR7 on Server and on client I tried UR7 and UR10.

    Monday, May 31, 2010 11:33 AM
  • is this problem only heppens on custom pages? what about existing pages?

    if there is any Java script on load of existing page then remove then and then see if the problem persists..

    Monday, May 31, 2010 11:36 AM
  • Existing pages are OK, everithing is going as it is supposed to.

    On two custom pages Java script in On Load looks like this:

    if (window.top == window)
    return;
    
    var iframe = document.createElement('iframe');
    iframe.setAttribute('src', '');
    iframe.setAttribute('style', 'position: absolute; height: 0px; width: 0px; display: none;')
    
    document.body.appendChild(iframe);

    There is a Silverlight 3.0 application inside IFrame. After deleting OnLoad they still cause error.

    In others there in no javascript at all

    Monday, May 31, 2010 11:52 AM
  • It looks like CRM plugin queries a page for additional information about its content (only my thoughts). For example, CRM Help needs to know what chapter must be opened (context help), Advanced Find tries to load current view to fill default search options on opening, and so on. And as soon as it is just a custom page and it has nothing to do with CRM metainformation,these queries fail. Does anyone know how to at least forbid showing script error window? Or maybe some security tweaks may be applied to web-application, to which problematic pages belong (in IIS it is located under ISV folder of CRM-site)?

    Any help would be appreciated.

     

    Oleksandr Klymenko 

    Tuesday, June 1, 2010 8:03 AM
  • No suggestions?
    Thursday, June 3, 2010 6:20 AM
  • Hi,

    This is really strange behavious and my suggestion is to log call with microsoft support to see so they can enable trace on your server and find cause of the problem.

    Friday, June 4, 2010 1:41 PM
  • Hi,

    Log tracing is already enabled, but nothing about this error is logged as soon as it is script error.

    Sunday, June 6, 2010 10:18 PM
  • Still need help
    Oleksandr Klymenko,
    My Blog: www.darkaxe.wordpress.com
    Friday, June 11, 2010 7:21 AM
  • I'm getting the same issue, did you get any solution?


    Software Engineer / Microsoft CRM Consultant Alfapeople UK (London)
    Tuesday, November 2, 2010 5:41 PM
  • Hello guys again,

    I got a solution, although it's not the most elegant, your customer will be happier :)

    When you click the "Advanced Find", "Help",..., buttons, you can debug the scripting error, find out the function to be called and overwrite it from your custom page.

    For example, for the "Advanced Find" button, this is the code you can find behind:

     try { top.stage.openAdvFind(); } catch (e) { openStdWin("/WealthDev/AdvancedFind/AdvFind.aspx", "Search", 700, 600); }

    The error is raised when "openAdvFind" is called, so from your custom page you can do something like this:

    <html>
    <head>
    </head>
    <body>
     <script language="javascript">
    	 top.stage.openAdvFind = function()
    	 {
    			openStdWin("/MyOrganisation/AdvancedFind/AdvFind.aspx", "Search", 700, 600); 
    	 }
     </script>
    </body>
    </html>
    

    if you have multi-organisations, you can replace "MyOrganisation" for a variable, whose value will be achieved from the parameter "orgname" in the QueryString of the URL (remember to enable the "PassParams" attribute for this SiteMap element).

    I hope this help.


    Software Engineer / Microsoft CRM Consultant Alfapeople UK (London)
    Tuesday, November 2, 2010 6:31 PM