locked
Problem with CRM Form Button In Chrome Browser RRS feed

  • Question

  • Hi,

    I'm using JavaScript function to show a button on CRM 2011 form which will call the method and do required operations on CRM (Creating related entity records and refresh sub-grid). This is working fine in IE versions. But it is causing issue with Chrome browser. Here when the button is clicked, all the operation were getting done and at the end it is asking for page navigation which is leading to Error Page. I'm using CRM rollup13.

    Below is the screen shot that shows the confirmation message and error page.

    Confirmation message


    By clicking on Leave this Page, the error page is displayed as below.

    Error page navigated to

    I thought the problem is with the code which refreshes the subgrid and commented the code. Then also the same issue occurred.

    Below is the method I'm calling to convert the field to Button and perform the operations.

    // CRM 2011 Style Button     
    // Creates a button from a form field
    function ConvertToButton(fldName, btnLabel, btnWidth, functionName) {
        //debugger
        var btn = '<button id="btn_' + fldName + '" ' +
                         ' style="width:' + btnWidth + '" ' +
                           ' class="ms-crm-Button" ' +
                         ' onmouseover="Mscrm.ButtonUtils.hoverOn(this);" ' +
                        ' onmouseout="Mscrm.ButtonUtils.hoverOff(this);" ' +
                        'onclick=\"' + functionName + '"; \'' +
                       '>' + btnLabel + '</button>';
        //Convert the field to button                   
        document.getElementById(fldName + "_d").innerHTML = btn;
    }

    Can anyone help me in resolving this issue please.

    Regards,

    Syai Reddy D

    Osmosys


    Regards, Syai, Osmosys


    • Edited by Syai Saturday, September 21, 2013 7:49 AM
    Saturday, September 21, 2013 7:49 AM

All replies

  • You said there was code to create records when you click the button? Is that the code causing the issue or is it the rendering of the button?

    You said it was when the button was clicked, but the code is only showing the button being created.

    Can you post the code you're calling on click on the button if that is causing the issue?


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    Sunday, September 22, 2013 7:08 AM
  • Hi Paul,

                Thanks for the reply. I've checked the code related to record creation which is not causing any issue related to page refresh. I've also checked by calling other functions on button click, where I've faced the same issue. And I'm wondering this is happening with other browsers (Not Internet Explorer).

    Regards,

    Syai,

    Osmosys


    Regards, Syai, Osmosys

    Sunday, September 22, 2013 1:40 PM
  • Hi

    XML is not suported on CROSS browser if you use it in you code then it shows error.

    Monday, September 23, 2013 6:56 AM
  • Please put the following code within an html resource and add that resource to the form:-

    <HTML lang=en xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE></TITLE> <SCRIPT language=javascript> function hello() { document.parentWindow.parent.createQuoteProduct(); } </SCRIPT> <META charset=utf-8> <STYLE type=text/css> #Button1 { width: 195px; } </STYLE> </HEAD> <BODY> <P><INPUT id=Button1 title="Add Product" onclick=hello() value="Add Product" type=button></P></BODY></HTML>

    You can put the function to call(createQuoteProduct) onload of form.



    Regards Faisal

    Monday, September 23, 2013 3:28 PM