迁移到CRM 2016:无法获得属性&get39Data'未定义或空引用

时间:2016-02-18 15:13:48

标签: dynamics-crm-2016

从CRM 2013迁移到CRM 2016(On Premise)后,我们在浏览器中显示错误消息,如:

  • 无法获取财产' getPageData '未定义或空引用
  • 无法获得财产' className '未定义或空引用
  • 无法获得财产' firstChild '未定义或空引用

错误发生在CRM的组件中。任何想法,原因是什么?



  <ReportVersion>1.0</ReportVersion>
  <ScriptErrorDetails>
   <Message>Unable to get property 'getPageData' of undefined or null reference</Message>
   <Line>2083</Line>
   <URL>/_static/form/formcontrols.js?ver=1804820318</URL>
   <PageURL>/form/page.aspx?lcid=1033&themeId=f499443d-2082-4938-8842-e7ee62de9a23&tstamp=197130723&updateTimeStamp=635905304768102438&userts=131002784247688030&ver=1804820318#etc=2&extraqs=%3fetc%3d2%26id%3d%257b7DE4DCC6-207F-E511-9528-005056A03927%257d&pagemode=iframe&pagetype=entityrecord&counter=1455804831411</PageURL>
   <Function>anonymousr:Unabletogetproperty'getPageData'ofundefinedornullreference</Function>
   <FunctionRaw>TypeError: Unable to get property 'getPageData' of undefined or null reference</FunctionRaw>
   <CallStack>
    <Function>anonymousr:Unabletogetproperty'getPageData'ofundefinedornullreference</Function>
   </CallStack>
  </ScriptErrorDetails>
&#13;
&#13;
&#13;

3 个答案:

答案 0 :(得分:2)

尝试在帖子末尾提供的建议 - https://community.dynamics.com/crm/f/117/p/190275/482107

何时发生错误?

答案 1 :(得分:2)

我&#39;当按业务流程的下一阶段时,v在8.2.2.112上有类似的错误[1]。为调试付出了很多努力,所以想把它记录下来。

汇总字段

错误是由为Money字段提供SUM的汇总字段引起的。 CRM和javascript函数生成的HTML并不匹配。

有罪行在第28871行调用的/_static/form/formcontrols.js内: XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetNextSibling(this.get_controlValue().parentNode)))))).innerHTML = CrmEncodeDecode.CrmHtmlDecode((this.$5_1.$3_2).get_currencySymbol());

这个返回null,因此吐出错误:XUI.Html.DomUtils.GetNextSibling(this.get_controlValue().parentNode

解决方案

  • FIX 1:启用&#34;使用旧版表格渲染&#34;在系统设置
  • 或修复2:从表单中删除货币汇总字段。
  • 或修复3:创建使用工作流程或插件计算的非汇总字段。
  • 或修复4:你可能会做一些jQuery的东西,并添加一些空的兄弟姐妹,它 - 预计。除非它可能显示重复的货币符号(至少对于欧元货币) - 一个作为前缀,另一个作为后缀。
  • 或修复5:最不受欢迎的方式:如果你在本地修补.js你自己。

    替换第28871行:

      XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetNextSibling(this.get_controlValue().parentNode)))))).innerHTML = CrmEncodeDecode.CrmHtmlDecode((this.$5_1.$3_2).get_currencySymbol());
    

    使用:

    if (XUI.Html.DomUtils.GetNextSibling(this.get_controlValue().parentNode) !== null) {
        XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetFirstChild(XUI.Html.DomUtils.GetNextSibling(this.get_controlValue().parentNode)))))).innerHTML = CrmEncodeDecode.CrmHtmlDecode((this.$5_1.$3_2).get_currencySymbol());
    }
    

[1]错误:

<ScriptErrorDetails>
   <Message>Cannot read property 'firstChild' of null</Message>
   <Line>0</Line>
   <URL>/form/page.aspx?lcid=1033&themeId=2cf54f8a-be4d-477c-a1f5-29b894a487ca&tstamp=53798526&updateTimeStamp=636392540341784672&userts=131546192871874626&ver=-1991520363#etc=3&extraqs=%3f_gridType%3d3%26etc%3d3%26id%3d%257b586C2C21-E8F8-E611-80F5-005056BD19EE%257d%26opened%3dgrid%26process%3dc9426a91-9fc0-4c2d-a21c-4b9d2a38a6d5%26processts%3d51389819%26rskey%3d%257b00000000-0000-0000-00AA-000010003001%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b00000000-0000-0000-00AA-000010003001%7d&counter=1510145890205</URL>
   <PageURL>/form/page.aspx?lcid=1033&themeId=2cf54f8a-be4d-477c-a1f5-29b894a487ca&tstamp=53798526&updateTimeStamp=636392540341784672&userts=131546192871874626&ver=-1991520363#etc=3&extraqs=%3f_gridType%3d3%26etc%3d3%26id%3d%257b586C2C21-E8F8-E611-80F5-005056BD19EE%257d%26opened%3dgrid%26process%3dc9426a91-9fc0-4c2d-a21c-4b9d2a38a6d5%26processts%3d51389819%26rskey%3d%257b00000000-0000-0000-00AA-000010003001%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b00000000-0000-0000-00AA-000010003001%7d&counter=1510145890205</PageURL>
   <Function>anonymous(dirtyVisiblePropertyData){var$v_0=dirtyVisiblePropertyData.getKeys();for(var$v_1=0;$v_1<$v_0.length;$v_1++){var$v_2=$v_0[$v_1];if(IsNull(this.get_viewMap().get_item($v_2))){}else{try{this.get_viewMap().get_item($v_2).update(dirtyVisiblePropertyD</Function>
   <FunctionRaw>function (dirtyVisiblePropertyData) {
        var $v_0 = dirtyVisiblePropertyData.getKeys();
        for (var $v_1 = 0; $v_1 < $v_0.length; $v_1++) {
            var $v_2 = $v_0[$v_1];
            if (IsNull(this.get_viewMap().get_item($v_2))) {
    </FunctionRaw>
   <CallStack>
    <Function>anonymous(dirtyVisiblePropertyData){var$v_0=dirtyVisiblePropertyData.getKeys();for(var$v_1=0;$v_1<$v_0.length;$v_1++){var$v_2=$v_0[$v_1];if(IsNull(this.get_viewMap().get_item($v_2))){}else{try{this.get_viewMap().get_item($v_2).update(dirtyVisiblePropertyData.get_item($v_2));}catch($v_3){Mscrm.CrmDebug.fail(String.format('ExceptionencounteredupdatingUIelement{0}:{1}',$v_2,$v_3.message));catchError($v_3.message,window.location.href,0,true);}}}}</Function>
    <Function>anonymous(){if(this.$AV_1){var$v_0=this.$4h_1;this.$4h_1=new(Mscrm.TurboForm.Control.TypedDictionary$1.$$(Mscrm.TurboForm.Control.PropertyBag))();this.ui.updateUI($v_0);}}</Function>
    <Function>anonymous(){this.$7A_1++;var$v_0=null;if(!this.$AE_1){setPerformanceMarkerTimestamp(String.format('UIUpdate{0}StartTime',this.$7A_1));$v_0=Xrm.Internal.startMetricsStopwatch(String.format('UIUpdate{0}',this.$7A_1));$v_0.start();}this.$8w_1=false;for(var$v_1=0;$v_1<this.$2F_1.length;$v_1++){var$v_2=this.$2F_1[$v_1];if(!IsNull($v_2)){$v_2.flushVisibilityChanges();}}if($v_0){$v_0.stop();setPerformanceMarkerTimestamp(String.format('UIUpdate{0}EndTime',this.$7A_1));}window.top.TurboFormLoadStartTime=null;}</Function>
    <Function>anonymous(){Mscrm.Performance.PerformanceMarkerManager.get_instance().addMarker('MDDEnd',1);try{var$v_0=Xrm.Internal.startMetricsStopwatch('PostOnLoadUIUpdate');$v_0.start();this.finishUIUpdate();$v_0.stop();}finally{this.$Ih_1();this.updateFormDirtyState();try{if(isOutlookHostedWindow()){getOutlookHostedWindow().handlePostOnLoad();}}catch($$e_1){}}}</Function>
    <Function>anonymous(){var$v_0=Xrm.Internal.startMetricsStopwatch('HandlePostOnLoad');$v_0.start();if(Mscrm.TurboForm.Control.PageManager.get_instance().$L_1===this){this.get_pidRequestManager().clearRecords();Mscrm.TurboForm.Control.PageManager.get_instance().handlePostOnLoad();var$v_1=Mscrm.TurboForm.Control.PageBootstrapper.getPageState();if(!IsNull($v_1)&&$v_1.formType!==7&&!$v_1.recordId.equals(Microsoft.Crm.Client.Core.Framework.Guid.get_empty())){Mscrm.TurboForm.Control.PageBootstrapper.requestSubGridData();}this.get_pidRequestManager().requestPidPtsWithLookupService();setAttributeInWindow('FormEntityLogicalName',(this.data.getEntity())?this.data.getEntity().getEntityName()||'':'');setAttributeInWindow('FormEntityTypeCode',(this.data.getEntity()&&!Mscrm.InternalUtilities.JSTypes.isNull(this.data.getEntity().getEntityTypeCode()))?this.data.getEntity().getEntityTypeCode().toString():'');if(!Mscrm.InternalUtilities.JSTypes.isNullOrEmptyString(window.CUSTOM_ETC_LIST)&&JSON.parse(window.CUSTOM_ETC_LIST).indexOf(this.data.getEntity().getEntityTypeCode())>-1){setAttributeInWindow('IsCustomEntity','true');}else{setAttributeInWindow('IsCustomEntity','false');}if(!IsNull(window.turboHeaderScriptIncludes)){if(this.scriptIncludesSearch(window.turboHeaderScriptIncludes,'/_static/cs/articlesearchribbon/articlesearchribbon.js')){Mscrm.CrmHeader.setScriptFileForTurboForm(Mscrm.CrmUri.create('/_static/CS/ArticleSearchRibbon/ArticleSearchRibbon.js'));}}Mscrm.TurboForm.Control.PageManager.get_instance().loadActionHubIframe();window.setTimeout(this.$$d_$Ff_1,15);if(!IsNull($v_1)&&$v_1.formType!==7){Mscrm.MetricsCollector.collectAndReportClientMetrics(2);}}else{Mscrm.TurboForm.Control.PageManager.get_instance().finishUIUpdate();}$v_0.stop();}</Function>
    <Function>anonymous(){returnb.apply(a,arguments)}</Function>
    <Function>anonymous(c,d){for(varb=0,e=a.length;b<e;b++)a[b](c,d)}</Function>
    <Function>anonymous(message){switch(message){case'TurboFormPostOnloadTimestamp':setPerformanceMarkerTimestamp('TurboFormPostOnloadTimestamp');Mscrm.Performance.PerformanceMarkerManager.get_instance().addMarker('TurboFormPostOnloadTimestamp',1);var$v_0=Mscrm.TurboForm.Control.CustomScriptsManager.get_instance().$7d_1.getHandler(String.format('MessageEventFormat_{0}',message));if(!IsNull($v_0)){$v_0();window.pageLoadedCheckForNavigateApi=true;if(!IsNull(window.parent)&&!IsNull(window.parent.parent)){window.parent.pageLoadedCheckForNavigateApi=true;window.parent.parent.pageLoadedCheckForNavigateApi=true;}}break;case'ScriptsAreLoaded':if(Mscrm.TurboForm.Control.CustomScriptsManager.get_instance().$57_1){Mscrm.TurboForm.Control.CustomScriptsManager.get_instance().$57_1=false;}var$v_1=Mscrm.TurboForm.Control.CustomScriptsManager.get_instance().$7d_1.getHandler(String.format('ScriptsAreLoaded',message));if(!IsNull($v_1)){$v_1();}break;}}</Function>
    <Function>SendMessageToPageManager(message)</Function>
    <Function>RunHandlerInternal(method,parameters,executionContext,executeIfAvailableOnly)</Function>
    <Function>RunHandlers()</Function>
    <Function>OnScriptTagLoaded(url)</Function>
    <Function>anonymous(){OnScriptTagLoaded(url);}</Function>
   </CallStack>
  </ScriptErrorDetails>

答案 2 :(得分:0)

感谢Andrii!

删除标题中的复合控件就可以了。

这似乎是CRM 2016中的一个错误,但我们的客户可以在标题中没有此信息。一切都好!

亲切的问候, 的Matthias