locked
errors have me thinking about form.navigate() behavior RRS feed

  • Question

  • Could the following error be caused by differentForm.navigate() call combined with the parallel script loading challenges?  (This isn't the only error message that I have seen, but the longest one.)

    Microsoft Dynamics CRM Error Report Contents
    
    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
       <Message>Unable to get property 'get_defaultValue' of undefined or null reference</Message>
       <Line>1155</Line>
       <URL>/_common/JsProvider.ashx?IsRefreshForm=true&ids=1545465446-1759665639-1968334880-202661451-1547461133-1992083491-1000289424-159335543-1194605645-1039841082-1314140682-1793205875-1376927455-1030632819-1181113682-232397045-468302605-1405388298-1731109441-2029667886-399776211-330369912-202888856-204060739-1025323794-513446117-1625018438-1460109179-1088147315-706656670-342519603-542820515-1946640899-1603536461-1220618931-511599809-1264077421-1188909594-783705869-374257838-502328314-1391165063-60010994-2050812538-512064351&ver=-1367595599</URL>
       <PageURL>/_forms/read/page.aspx?_gridType=3&etc=3&id=%7b21CF9445-998E-E311-A4B4-6C3BE5A8C0E8%7d&pagemode=iframe&preloadcache=1391711204720&rskey=20891584&theme=Outlook15White</PageURL>
       <Function>anonymous(){var$v_0=this.get_editControlBehavior().get_defaultValue();return!isNaN($v_0)&&!IsNull($v_0)?Mscrm.NumberUtility.addFormatting($v_0,this.get_$0_3().get_precision()):""}</Function>
       <CallStack>
        <Function>anonymous(){var$v_0=this.get_editControlBehavior().get_defaultValue();return!isNaN($v_0)&&!IsNull($v_0)?Mscrm.NumberUtility.addFormatting($v_0,this.get_$0_3().get_precision()):""}</Function>
       </CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
       <BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3; ASU2JS)</BrowserUserAgent>
       <BrowserLanguage>en-US</BrowserLanguage>
       <SystemLanguage>en-US</SystemLanguage>
       <UserLanguage>en-US</UserLanguage>
       <ScreenResolution>1093x614</ScreenResolution>
       <ClientName>Web</ClientName>
       <ClientTime>2014-02-06T12:26:47</ClientTime>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>1033</OrgLanguage>
        <OrgCulture>1033</OrgCulture>
        <UserLanguage>1033</UserLanguage>
        <UserCulture>1033</UserCulture>
        <OrgID>{2F567A75-0703-4F3B-8680-825EEA12F28C}</OrgID>
        <UserID>{AC039637-FC83-462F-B2AA-2F57DFE0E417}</UserID>
        <CRMVersion>6.0.1.462</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>
    

    The script resides on the OnLoad of the Opportunity which uses the form matching a value on the record.  I've read that there are known errors from JsProvider.ashx, possibly specific to Opportunity.  But there is no error when the script doesn't run, so I doubt that it is entity related.

    Also, this is testing for upgrade to 2013 and there is no error on the production 2011 instance.

    Thursday, February 6, 2014 6:37 PM

Answers

  • Turns out it was the parallel load timing issue.  This made it go away:

     setTimeout( function () { rightform.navigate(); }, 1500);

    • Marked as answer by mardukes Monday, February 10, 2014 3:17 PM
    Monday, February 10, 2014 3:17 PM

All replies

  • Hi

    Is it a JS library that you are including in form library ?

    Ensure that this is in sequence before the library where you are referencing it.

    CRM 2011 did not have any issue because of sequence of libraries.

    But so far in its intial stages, CRM 2013 seems to have this issue. Atleast thats what I experienced.

    Thursday, February 6, 2014 6:40 PM
  • I'm not sure I understand your question, but I'm loading

    • JSON, the most current of the public domain json.js
    • SDK.REST.js from SDK
    • our common function file
    • the file specific to Opportunity which contains the Opportunity_OnLoad function

    ...in that order.  Keep in mind that the sequence as it appears on the Form Properties hasn't mattered since 2011 UR 12 where form loading went to parallel in stead of in order.  This is why I'm doubtful about that being the issue as production instance (both are on-line) is sure to be beyond that UR level.  And that one is working fine.

    Thursday, February 6, 2014 7:35 PM
  • Yes that's the information I was looking from u I fully agree with u that there is no dependency on order of libraries included. They load and reference each other without any issue. But sometimes it happens that due to a slight dip in performance one file loads faster than other and it can't find the dependent library. If error you are getting is occasional. Probably this can be the issue. Bt if it is every time. Then it is something else.
    Thursday, February 6, 2014 8:14 PM
  • it's every time.  Here's another:

    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
       <Message>Error initializing component with element id='gridBodyTable' and with type='Mscrm.AppGridDefaultDataControl': Unable to get property 'length' of undefined or null reference</Message>
       <Line>0</Line>
       <URL>/main.aspx?etc=3&extraqs=%3f_gridType%3d3%26etc%3d3%26id%3d%257b9D72DC19-998E-E311-A4B4-6C3BE5A8C0E8%257d%26rskey%3d451724743%26theme%3dOutlook15White&pagemode=iframe&pagetype=entityrecord&rskey=451724743</URL>
       <PageURL>/main.aspx?etc=3&extraqs=%3f_gridType%3d3%26etc%3d3%26id%3d%257b9D72DC19-998E-E311-A4B4-6C3BE5A8C0E8%257d%26rskey%3d451724743%26theme%3dOutlook15White&pagemode=iframe&pagetype=entityrecord&rskey=451724743</PageURL>
       <Function>anonymous(type,properties,events,references,element){try{if(!Mscrm.PageManager.$1q)return$create(type,properties,events,references,element)}catch($v_0){if(!element)returnnull;var$v_1=String.format("Errorinitializingcomponentwithelementid='{0}'andwithtype=</Function>
       <CallStack>
        <Function>anonymous(type,properties,events,references,element){try{if(!Mscrm.PageManager.$1q)return$create(type,properties,events,references,element)}catch($v_0){if(!element)returnnull;var$v_1=String.format("Errorinitializingcomponentwithelementid='{0}'andwithtype='{1}':{2}",!element?"null":element.id,!type?"null":type.getName(),$v_0.message);catchError($v_1,window.location.href,0,true)}returnnull}</Function>
        <Function>anonymous(){var$v_0=$get("gridBodyTable",this.get_element());if(!IsNull($v_0)){var$v_1={};$v_1["parentGridControl"]=this;var$v_2={};$v_2["onSelectionChange"]=this.$$d_$7Y_3;$v_2["onBeforeFormLoad"]=this.$$d_$4a_3;Mscrm.CrmUIComponent.crmCreate(Mscrm.AppGridDefaultDataControl,$v_1,$v_2,null,$v_0)}}</Function>
        <Function>anonymous(html,updatePaging){var$v_0=this.GetParameter("expandable"),$v_1=this.GetParameter("maxrowsbeforescroll");if($v_0==="1"&&!parseInt($v_1,10))html=html+'<divstyle="height:16px;"></div>';$get(this.get_id()+"_divDataArea").innerHTML=html;this.$2z_3();this.$4M_3(updatePaging)}</Function>
        <Function>anonymous(result,command){if(result.get_success()&&!isNullOrEmptyString(result.get_returnValue())){var$v_0=XUI.Xml.LoadXml(result.get_returnValue());this.SetProperty("pagingCookie",XUI.Xml.GetText(XUI.Xml.SelectSingleNode($v_0,"gridXml/pagingCookie",null)));this.setGridData(XUI.Xml.GetText(XUI.Xml.SelectSingleNode($v_0,"gridXml/gridHtml",null)),true);var$v_1=newArray(3);$v_1[0]="effectiveFetchXml";$v_1[1]="isFetchXmlNotFinal";$v_1[2]="fetchXmlForFilters";$v_1[3]="viewts";for(var$v_2=this.GetParameter("viewts"),$v_4=0;$v_4<$v_1.length;$v_4++){var$v_5=XUI.Xml.SelectSingleNode($v_0,String.format("gridXml/gridParams/div[@id='{0}']",$v_1[$v_4]),null);$v_5&&this.SetParameter(XUI.Xml.GetText($v_5.attributes.getNamedItem("id")),XUI.Xml.GetText($v_5))}var$v_3=this.GetParameter("viewts");this.cacheValidation($v_2,$v_3)}elsethis.displayFailedMessage();this.fireEvents(command);this.$2N_3(null);this.$2k_3=newDate;this.$1I_3=false;Mscrm.Utilities.addControlMarker(this.get_id(),"Subgrid","FinishLoadTimestamp",(newDate).getTime().toString())}</Function>
        <Function>anonymous(){this.finishShowLoadingMessage();this.refreshComplete(this.$2C_3,this.$2B_3);this.$7S_4()}</Function>
        <Function>anonymous(result,command){this.$2C_3=result;this.$2B_3=command;Mscrm.Utilities.isRefreshForm()&&this.$4O_4();this.$78_4()}</Function>
        <Function>anonymous(){returnb.apply(a,arguments)}</Function>
        <Function>anonymous(){if(this.$2T_0.readyState===4){this.$2T_0.onreadystatechange=null;if(!this.$3m_0.$1e_0&&this.$2T_0.status){var$v_0=newMscrm.RemoteCommandXmlResult(this.$3m_0,this.$2T_0,true);this.$5S_0($v_0,this.$3m_0);this.$2T_0.abort()}}}</Function>
        <Function>anonymous(){returnb.apply(a,arguments)}</Function>
       </CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
       <BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3; ASU2JS)</BrowserUserAgent>
       <BrowserLanguage>en-US</BrowserLanguage>
       <SystemLanguage>en-US</SystemLanguage>
       <UserLanguage>en-US</UserLanguage>
       <ScreenResolution>1093x614</ScreenResolution>
       <ClientName>Web</ClientName>
       <ClientTime>2014-02-06T17:27:55</ClientTime>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>1033</OrgLanguage>
        <OrgCulture>1033</OrgCulture>
        <UserLanguage>1033</UserLanguage>
        <UserCulture>1033</UserCulture>
        <OrgID>{2F567A75-0703-4F3B-8680-825EEA12F28C}</OrgID>
        <UserID>{AC039637-FC83-462F-B2AA-2F57DFE0E417}</UserID>
        <CRMVersion>6.0.1.462</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>
    

    • Edited by mardukes Thursday, February 6, 2014 11:30 PM more
    Thursday, February 6, 2014 9:01 PM
  • this one happens when the form closes:

    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
       <Message>Unable to get property 'length' of undefined or null reference</Message>
       <Line>5</Line>
       <URL>/_common/global.ashx?ver=-1367595599</URL>
       <PageURL>/main.aspx?etc=3&extraqs=%3f_gridType%3d3%26etc%3d3%26id%3d%257b9D72DC19-998E-E311-A4B4-6C3BE5A8C0E8%257d%26rskey%3d451724743%26theme%3dOutlook15White&pagemode=iframe&pagetype=entityrecord&rskey=451724743</PageURL>
       <Function>anonymous(a,e,f){vard=null,c=a._events[e];for(varb=0,g=c.length;b<g;b++)if(c[b].handler===f){d=c[b].browserHandler;break}if(a.removeEventListener)a.removeEventListener(e,d,false);elseif(a.detachEvent)a.detachEvent("on"+e,d);c.splice(b,1)}</Function>
       <CallStack>
        <Function>anonymous(a,e,f){vard=null,c=a._events[e];for(varb=0,g=c.length;b<g;b++)if(c[b].handler===f){d=c[b].browserHandler;break}if(a.removeEventListener)a.removeEventListener(e,d,false);elseif(a.detachEvent)a.detachEvent("on"+e,d);c.splice(b,1)}</Function>
       </CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
       <BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3; ASU2JS)</BrowserUserAgent>
       <BrowserLanguage>en-US</BrowserLanguage>
       <SystemLanguage>en-US</SystemLanguage>
       <UserLanguage>en-US</UserLanguage>
       <ScreenResolution>1093x614</ScreenResolution>
       <ClientName>Web</ClientName>
       <ClientTime>2014-02-06T17:28:46</ClientTime>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>1033</OrgLanguage>
        <OrgCulture>1033</OrgCulture>
        <UserLanguage>1033</UserLanguage>
        <UserCulture>1033</UserCulture>
        <OrgID>{2F567A75-0703-4F3B-8680-825EEA12F28C}</OrgID>
        <UserID>{AC039637-FC83-462F-B2AA-2F57DFE0E417}</UserID>
        <CRMVersion>6.0.1.462</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>
    

    • Marked as answer by mardukes Monday, February 10, 2014 3:17 PM
    • Unmarked as answer by mardukes Monday, February 10, 2014 3:17 PM
    Thursday, February 6, 2014 11:31 PM
  • Turns out it was the parallel load timing issue.  This made it go away:

     setTimeout( function () { rightform.navigate(); }, 1500);

    • Marked as answer by mardukes Monday, February 10, 2014 3:17 PM
    Monday, February 10, 2014 3:17 PM
  • Can you please illustrate this answer like where do I need to put this line of code , do I need to create javascript library or any specific place where I can put this single line of code and also do I need to put function name at place of function() then please tell that function name also

    Thanks

    Monday, May 19, 2014 9:15 AM
  • same here kindly help me how to resolve this
    Monday, May 19, 2014 9:16 AM
  • There is no function name.  It's inline.  It's a function pointer whose body is {rightform.navigate() }

    What the line of code is doing is wrapping that in a setTimeout().  So, unless you're calling form.navigate(), this solution doesn't apply to your situation.  But if you are, then you know where it is that you have to wrap it in the delay.

    The function pointer is an argument to the functions in the SDK.JSON.js -- CRM create, retrieve, update and delete operations.  Again, if you are not using those, then this might not pertain to you.  If you are then you know where in your code the error is occurring.

    I can't remember for sure, but I think I was retrieving the Opportunity's Owner's Business Unit in order to determine which was the "right form" and telling the function to navigate() to the "right form" -- hence the loading issues.  If that's not what you're doing then you have to think more about where you might be having form load issues and remedy your problem.

    Tuesday, May 20, 2014 8:32 PM
  • In CRM 2013, When I do Save and New in Opportunity/Email entity, I am getting the same exception as "Error initializing component with element id='gridBodyTable' and with type='Mscrm.AppGridDefaultDataControl': "  And these entity forms has grid controls. Before the form loads it throwing this exception. And this exception is not observed if we remove all the subgrid controls in the form. Only in the forms which has subgrid controls when we click save and new the mentioned exception is observed. Can u share your thoughts on this ?

    Friday, May 23, 2014 9:27 AM
  • Seems to me that these are things beyond our control, i.e. bugs.  Do you know if you have Service Pack 1 applied?
    Wednesday, June 11, 2014 1:15 PM