locked
CRM 2011 RU 12 - there was an error with this fields customized event Error:Undefined RRS feed

  • Question

  • Currently we are Using CRM 2011 + RU 8 and wants to upgrade to the latest RU i.e 17 .. we have couple of JS (onload/onsave) so we want to make sure that after the upgrade users should not receive any scripting errors.. we did a test migration on to a Fresh CRM server (2011 + RU 17) and everything worked very fine, no js errors at all... but when we try to patch (RU 17) production environment the below error comes up (form onload) :

    =======================
    There was an error with this field's customized event
    .

    Field:window.

    Event:onload.

    Error:undefined

    =======================

    Here is the Js

    function Form_onload()
    {
    var s=document.createElement("<SCRIPT language='javascript' src='/_static/_grid/cmds/util.js'>");
    document.getElementsByTagName("head")[0].appendChild(s);
    
    var _action = '';
    gateway_ChargeInvoice=function(action) 
    {debugger
        _action = action;
        DisplayActionMsg("Processing Transaction...", 350, 150);
        window.setTimeout(gateway_ChargeInvoiceProcessing, 100);
    }
    
    function gateway_ChargeInvoiceProcessing() 
    {debugger
        var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        var url = "/isvforms/Invoice/ChargeInvoice.aspx?Method=gatewayNet&id=" + Xrm.Page.data.entity.getId() + "&orgname=" + Xrm.Page.context.getOrgUniqueName() + "&act=" + _action;
        var msg = "";
    
        xmlhttp.Open("POST", url, false);
        xmlhttp.Send();
        msg = xmlhttp.responseText;
        HideActionMsg();
        alert(msg);
    }
    ChargeInvoice=function(action)
    {
        _action = action;
        DisplayActionMsg("Processing Transaction on gateway2...", 350, 150);
    	window.setTimeout(ChargeInvoiceProcessing, 100);
    }
    
    function ChargeInvoiceProcessing()
    {
    	var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    	var url="/isvforms/Invoice/ChargeInvoice.aspx?id="+Xrm.Page.data.entity.getId() +"&orgname="+Xrm.Page.context.getOrgUniqueName()+"&act="+_action;
    	var msg="";
    
    	xmlhttp.Open("POST", url, false);
    	xmlhttp.Send();
    	msg=xmlhttp.responseText;
    	HideActionMsg();
    	alert(msg);
    }
    
    gateway2Action = function(action)
    {
        _action = action;
        DisplayActionMsg("Please wait while the invoice Email is created.", 350, 150);
        if(action == 'gateway')
        {
            window.setTimeout(ChargeInvoiceProcessing, 100);
        }
        else
        {
            window.setTimeout(gateway2ActionProcessing, 100);
        }
    }
    
    function gateway2ActionProcessing()
    {
    	var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    	var url="/isvforms/Invoice/gateway2PaymentActions.aspx?id="+Xrm.Page.data.entity.getId() +"&orgname="+Xrm.Page.context.getOrgUniqueName()+"&act="+_action;
    	var msg="";
    
    	xmlhttp.Open("POST", url, false);
    	xmlhttp.Send();
    	msg=xmlhttp.responseText;
    	HideActionMsg();
    	alert(msg);
    }
    
    function HideButtons()
    {
     
        if (document.getElementById('EntityStatusText')!= null)
        {
            var toolBarButtons = document.all.mnuBar1.rows[0].cells[0].childNodes[0].childNodes; 
    
            var innerHTML = '';
            if(Xrm.Page.getAttribute("ms_paymentaction").getValue() == '4')//New
            {
                innerHTML = "<SPAN class=ms-crm-Menu-Label><A class=ms-crm-Menu-Label tabIndex=-1><SPAN class=ms-crm-MenuItem-TextFirst tabIndex=0>gateway2 Actions</SPAN><IMG class=ms-crm-Menu-DownArrow id=mnuDown style=\"BACKGROUND-POSITION-Y: -32px; BACKGROUND-IMAGE: url(/_imgs/imagestrips/control_imgs_1.gif); WIDTH: 11px; CLIP: rect(0px 11px 16px 0px); HEIGHT: 16px\" alt=More src=\"/_imgs/imagestrips/transparent_spacer.gif\"></A><A class=atLink title=\"Open the Accessible form of the gateway2 Actions menu\" onclick=\"return false;\" tabIndex=-1 href=\"javascript:onclick();\" target=_self></A></SPAN>"+
                            "<DIV style=\"DISPLAY: none\">"+
                            "<UL class=ms-crm-MenuList id=\"mnuNew_0_gateway2 Actions\">"+
                            "<LI class=ms-crm-MenuItem-Label id=ISV_New_25_gateway tabIndex=-1 action=\"gateway2Action('gateway')\"><SPAN class=ms-crm-MenuItem-Label><A class=ms-crm-MenuLink onclick=\"return false;\" tabIndex=-1 href=\"javascript:onclick();\" target=_self><SPAN class=ms-crm-MenuItem-Icon></SPAN><SPAN class=ms-crm-MenuItem-Text tabIndex=0>gateway</SPAN></A></SPAN></LI>"+
                            "<LI class=ms-crm-MenuList-Spacer tabIndex=-1>"+
                            "<HR class=ms-crm-MenuList-Spacer>"+
                            "</LI>"+
                            "<LI class=ms-crm-MenuItem-Label id=ISV_New_29_ChargeInvoice tabIndex=-1 action=\"ChargeInvoice('Sale')\"><SPAN class=ms-crm-MenuItem-Label><A class=ms-crm-MenuLink onclick=\"return false;\" tabIndex=-1 href=\"javascript:onclick();\" target=_self><SPAN class=ms-crm-MenuItem-Icon></SPAN><SPAN class=ms-crm-MenuItem-Text tabIndex=0>Charge Invoice</SPAN></A></SPAN></LI></UL></DIV>";
            }
            else if(Xrm.Page.getAttribute("ms_paymentaction").getValue() == '1')//gatewayd
            {
                innerHTML = "<SPAN class=ms-crm-Menu-Label><A class=ms-crm-Menu-Label tabIndex=-1><SPAN class=ms-crm-MenuItem-TextFirst tabIndex=0>gateway2 Actions</SPAN><IMG class=ms-crm-Menu-DownArrow id=mnuDown style=\"BACKGROUND-POSITION-Y: -32px; BACKGROUND-IMAGE: url(/_imgs/imagestrips/control_imgs_1.gif); WIDTH: 11px; CLIP: rect(0px 11px 16px 0px); HEIGHT: 16px\" alt=More src=\"/_imgs/imagestrips/transparent_spacer.gif\"></A><A class=atLink title=\"Open the Accessible form of the gateway2 Actions menu\" onclick=\"return false;\" tabIndex=-1 href=\"javascript:onclick();\" target=_self></A></SPAN>"+
                            "<DIV style=\"DISPLAY: none\">"+
                            "<UL class=ms-crm-MenuList id=\"mnuNew_0_gateway2 Actions\">"+
                            "<LI class=ms-crm-MenuItem-Label id=ISV_New_26_Capture tabIndex=-1 action=\"gateway2Action('Captured')\"><SPAN class=ms-crm-MenuItem-Label><A class=ms-crm-MenuLink onclick=\"return false;\" tabIndex=-1 href=\"javascript:onclick();\" target=_self><SPAN class=ms-crm-MenuItem-Icon></SPAN><SPAN class=ms-crm-MenuItem-Text tabIndex=0>Capture</SPAN></A></SPAN></LI>"+
                            "<LI class=ms-crm-MenuItem-Label id=ISV_New_27_Cancel tabIndex=-1 action=\"gateway2Action('Void')\"><SPAN class=ms-crm-MenuItem-Label><A class=ms-crm-MenuLink onclick=\"return false;\" tabIndex=-1 href=\"javascript:onclick();\" target=_self><SPAN class=ms-crm-MenuItem-Icon></SPAN><SPAN class=ms-crm-MenuItem-Text tabIndex=0>Cancel</SPAN></A></SPAN></LI>"+
                            "<LI class=ms-crm-MenuList-Spacer tabIndex=-1>"+
                            "<HR class=ms-crm-MenuList-Spacer>"+
                            "</LI>"+
                            "<LI class=ms-crm-MenuItem-Label id=ISV_New_28_analyse tabIndex=-1 action=\"gateway2Action('analyse')\"><SPAN class=ms-crm-MenuItem-Label><A class=ms-crm-MenuLink onclick=\"return false;\" tabIndex=-1 href=\"javascript:onclick();\" target=_self><SPAN class=ms-crm-MenuItem-Icon></SPAN><SPAN class=ms-crm-MenuItem-Text tabIndex=0>analyse</SPAN></A></SPAN></LI>";
            }
    //       else if(Xrm.Page.getAttribute("ms_paymentaction").getValue() == '2')//Captured
    //        {
    //            toolBarButtons[i].style.display = 'none';
    //        }
    //        else if(Xrm.Page.getAttribute("ms_paymentaction").getValue() == '3')//Void
    //        {
    //            toolBarButtons[i].style.display = 'none';
    //        }
            for (var i = 0 ; i < toolBarButtons.length ; i++)  
            {
                if(toolBarButtons[i].id == 'New_0_gateway2 Actions')
                {  
                    if(document.getElementById('EntityStatusText').firstChild.nodeValue   != 'Active')
                    {
                        toolBarButtons[i].style.display = 'none';  
                    }
                    else
                    {
                        toolBarButtons[i].innerHTML = innerHTML;
                    }
                }
            }
        }
    }
    
    HideButtons();
    }

    Any suggestions?

    thanks.

     




    • Edited by Ja08 Wednesday, August 27, 2014 8:04 AM
    Wednesday, August 27, 2014 7:06 AM