locked
Error occurs on refresh/load of an Email Entity Form opened via window.open method and hence the navigation bar gets hidden. RRS feed

  • Question

  • Error Detail :

    Error initializing component with element id='navBar' and with type='Mscrm.NavBar': The URI to be decoded is not a valid encoding.

    Method/code used :

        try {
            var extraqs = '';
            extraqs += "&xyz_subject=" + Xrm.Page.getAttribute("subject").getValue();
            extraqs += "&xyz_description=" + escape(Xrm.Page.getAttribute("description").getValue());
            window.open(Xrm.Page.context.getClientUrl() + "/main.aspx?etn=email&extraqs=" + encodeURIComponent(extraqs) + "&histKey=" + Math.floor(Math.random() * 10000) + "&newWindow=true&pagetype=entityrecord", "_blank", "resizable=1");
        }




    • Edited by FAKHRI09 Thursday, February 26, 2015 12:17 PM
    Thursday, February 26, 2015 11:18 AM

Answers

  • This got resolved by updating the code as below (removing a call to escape() method) :-

    extraqs += "&xyz_description=" + Xrm.Page.getAttribute("description").getValue();

    • Marked as answer by FAKHRI09 Thursday, February 26, 2015 12:49 PM
    Thursday, February 26, 2015 12:48 PM

All replies

  • window.open is not supported way of opening form. Use openEntityForm()

    https://msdn.microsoft.com/en-us/library/jj602956.aspx

    Regards,

    Jithesh

    Thursday, February 26, 2015 11:25 AM
  • Hi Jithesh,
    If i use openEntityForm(), i am not able to open it in a new window. Only window.open() allows me to open a form in a new browser window.
    also the above code opens the form in a new window but its just that the ribbon is loading and visible for a while and then suddenly gets partly ie about 80% hidden.
    • Edited by FAKHRI09 Thursday, February 26, 2015 12:15 PM
    Thursday, February 26, 2015 12:15 PM
  • This got resolved by updating the code as below (removing a call to escape() method) :-

    extraqs += "&xyz_description=" + Xrm.Page.getAttribute("description").getValue();

    • Marked as answer by FAKHRI09 Thursday, February 26, 2015 12:49 PM
    Thursday, February 26, 2015 12:48 PM