Hi Folks
I've spent all day on this one and out of options hoping this will be a standard gotcha type issue. I'm seeing a real weird error and struggling to even trace the root cause. The scenario here is that we have two users both have system admin privileges (dev online 2016 sandbox). There is a custom form, with "no" JS libraries associated with it on the form. Whenever I access a contact record then navigate away it always gives me an error for *all* other users except one (namely myself). Then to make it more confusing in the UAT environment (Same tenant) the error happens for all users (myself included). Different behavior but the same solution and security role in both. The form has been set to be available to everyone under the form enable security role settings. All other contact forms work without issue! As I said earlier there is no form library on the custom form. The only thing I did modify in dev was a subgrid's + behavior via Ribbon Bench to show a search instead of a quick create form.

The error details:
<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>Unable to get property 'className' of undefined or null reference</Message>
<Line>0</Line>
<URL>/form/page.aspx?lcid=1033&themeId=8dbb98e6-a1a8-40ed-c83f-688767fb9a85&tstamp=627957&updateTimeStamp=635906496502128753&userts=131000265151606335&ver=-114056169#etc=2&extraqs=%3f_gridType%3d2%26etc%3d2%26id%3d%257b6DA6E5B9-88DF-E311-B8E5-6C3BE5A8B200%257d%26rskey%3d%257b00000000-0000-0000-00AA-000010001004%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b00000000-0000-0000-00AA-000010001004%7d&counter=1455553167284</URL>
<PageURL>/form/page.aspx?lcid=1033&themeId=8dbb98e6-a1a8-40ed-c83f-688767fb9a85&tstamp=627957&updateTimeStamp=635906496502128753&userts=131000265151606335&ver=-114056169#etc=2&extraqs=%3f_gridType%3d2%26etc%3d2%26id%3d%257b6DA6E5B9-88DF-E311-B8E5-6C3BE5A8B200%257d%26rskey%3d%257b00000000-0000-0000-00AA-000010001004%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b00000000-0000-0000-00AA-000010001004%7d&counter=1455553167284</PageURL>
<Function>anonymous(){var$v_0=this.$9H_1.toDictionary();var$$dict_3=$v_0;for(var$$key_4in$$dict_3){var$v_2={key:$$key_4,value:$$dict_3[$$key_4]};var$v_3=$v_2.value;if(!$v_3.$5p_2){$v_3.initialize();}}var$v_1=this.get_viewMap().toDictionary();var$$dict_9=$v_1;for(va</Function>
<FunctionRaw>function() {
var $v_0 = this.$9H_1.toDictionary();
var $$dict_3 = $v_0;
for (var $$key_4 in $$dict_3) {
var $v_2 = { key: $$key_4, value: $$dict_3[$$key_4] };
var $v_3 = $v_2.value;
if (!$v</FunctionRaw>
<CallStack>
<Function>anonymous(){var$v_0=this.$9H_1.toDictionary();var$$dict_3=$v_0;for(var$$key_4in$$dict_3){var$v_2={key:$$key_4,value:$$dict_3[$$key_4]};var$v_3=$v_2.value;if(!$v_3.$5p_2){$v_3.initialize();}}var$v_1=this.get_viewMap().toDictionary();var$$dict_9=$v_1;for(var$$key_Ain$$dict_9){var$v_4={key:$$key_A,value:$$dict_9[$$key_A]};var$v_5=$v_4.value;try{$v_5.bind();}catch($v_6){Mscrm.CrmDebug.fail(String.format('Exceptionencounteredbinding{0}:{1}',$v_5.getKey(),$v_6.message));catchError($v_6.message,window.location.href,0,true);}}}</Function>
<Function>anonymous(){this.$9d_1=true;this.ui.bindUI();if(this.$4L_1.toArray().length>0){Mscrm.TurboForm.Control.PageManager.get_instance().startUIUpdate();}}</Function>
<Function>anonymous(){this.$M_1.bindUI();}</Function>
<Function>anonymous($p0,$p1,$p2){var$v_0=$p0._error;if(!IsNull($v_0)){var$v_1=Mscrm.ErrorInformation.createErrorInfo($v_0.Code,$v_0.DisplayText,$v_0.SerializedException);var$v_2=Mscrm.Utilities.createCallbackFunctionObject('errorDialogCallback',Mscrm.TurboForm.Control.PageBootstrapper,null,false);openErrorDlg($v_0.Code,$v_0.DisplayText,$v_1,0,0,$v_2);return;}else{for(var$$arr_6=$p0.Descriptor.FormDescriptor,$$len_7=$$arr_6.length,$$idx_8=0;$$idx_8<$$len_7;++$$idx_8){var$v_C=$$arr_6[$$idx_8];Mscrm.TurboForm.Control.PageBootstrapper.$D0($v_C);}var$v_3='TODO:Handlelayouttemplatenotfound.';var$v_4=Mscrm.TurboForm.Control.PageBootstrapper.$40();$v_4.descriptors=$p0.Descriptor.FormDescriptor;$v_4.ProcessControlRule=$p0.processControlRule;$v_4.primaryFormId=newMicrosoft.Crm.Client.Core.Framework.Guid($p0.Descriptor.PrimaryFormId);$v_4.entityMetadata=Mscrm.TurboForm.Control.PageBootstrapper.$HZ($p0.entityMetadata);$v_4.InlineEditSubGrids=Mscrm.TurboForm.Control.PageBootstrapper.$Ha($p0.InlineEditSubGrids);var$v_5=$p0.header;$v_4.applicationInitDeferredStatements=$p0.header.ApplicationInitDeferredStatements;$v_4.sfaTabsInitDeferredStatements=$p0.header.SFATabsInitDeferredStatements;$v_4.caseSFATabsInitDeferredStatements=$p0.header.CaseSFATabsInitDeferredStatements;var$v_6=Xrm.Internal.startMetricsStopwatch('InjectLayoutIncludestoPage');$v_6.start();Sys.Application.beginCreateComponents();eval($v_5.TurboApplicationInitStatements);Sys.Application.endCreateComponents();Mscrm.TurboForm.Control.PageBootstrapper.$Cq($v_5.StyleIncludes);Mscrm.TurboForm.Control.PageBootstrapper.$Cm($v_5.TurboScriptIncludes);Mscrm.TurboForm.Control.DisposalManager.clearExistingDataClientVariables();Mscrm.TurboForm.Control.DisposalManager.clearExistingLayoutClientVariables();Mscrm.TurboForm.Control.PageBootstrapper.$GF($v_5.ClientVariables);$v_6.stop();var$v_7=Xrm.Internal.startMetricsStopwatch('RenderFormLayout');$v_7.start();var$v_8=$v_5.JQueryTemplates;$v_4.templates=$v_8;for(var$v_D=0;$v_D<$v_8.length;$v_D++){var$v_E=$v_8[$v_D];if($v_E.Key==='rootJQueryTemplate'){$v_3=$v_E.Value;break;}}Mscrm.TurboForm.Control.PageBootstrapper.$Hq($v_3);$v_7.stop();var$v_9=Xrm.Internal.startMetricsStopwatch('InitializeApplicationComponents');$v_9.start();Sys.Application.beginCreateComponents();eval(createFormControlLite);eval(createPageManager);eval(createEventManager);eval(SubGridCommandBarData);Sys.Application.endCreateComponents();$v_9.stop();if($v_4.formType!==7&&!$v_4.recordId.equals(Microsoft.Crm.Client.Core.Framework.Guid.get_empty())){var$v_F=Xrm.Internal.startMetricsStopwatch('RequestSubgridsData');$v_F.start();Mscrm.TurboForm.Control.PageBootstrapper.$Ht();$v_F.stop();}var$v_A=Xrm.Internal.startMetricsStopwatch('InitializeXrmControlsandData');$v_A.start();Mscrm.TurboForm.Control.PageManager.get_instance().initialize();$v_A.stop();var$v_B=Xrm.Internal.startMetricsStopwatch('BindXrmtoHTML');$v_B.start();Mscrm.TurboForm.Control.PageManager.get_instance().bindUI();$v_B.stop();Mscrm.TurboForm.Control.PageManager.get_instance().initializeProcessControl($v_4);$v_4.layoutReady=true;Xrm.XrmPerformance.measureTime('OnLayoutReadyhandlers',function(){returnMscrm.TurboForm.Control.PageBootstrapper.$6t('OnLayoutReady');});Mscrm.Performance.PerformanceMarkerManager.get_instance().addMarker('PageReadyforDataBind',1);Mscrm.TurboForm.Control.PageBootstrapper.$E8($p1,$p2);}}</Function>
<Function>anonymous($p1_0){$v_0.stop();var$v_1=Xrm.Internal.startMetricsStopwatch('ParseFormLayoutResponseJson');$v_1.start();var$v_2=Mscrm.TurboForm.Control.PageBootstrapper.$BE($p1_0);$v_1.stop();if($v_2){var$v_3=Mscrm.TurboForm.Control.PageBootstrapper.$F3($p1);var$v_4=Mscrm.TurboForm.Control.PageBootstrapper.$F2($p1);var$v_5=Xrm.Internal.startMetricsStopwatch('ProcessFormLayout');$v_5.start();Mscrm.TurboForm.Control.PageBootstrapper.$Hc($v_2,$v_3,$v_4);$v_5.stop();}}</Function>
<Function>anonymous(){if($v_0.readyState!==4){return;}$v_0.onreadystatechange=null;if($v_0.status!==200){}successCallback($v_0.responseText);$v_0=null;}</Function>
</CallStack>
</ScriptErrorDetails>
<ClientInformation>
<BrowserUserAgent>Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Tablet PC 2.0; MS-RTC LM 8; InfoPath.3; rv:11.0) like Gecko</BrowserUserAgent>
<BrowserLanguage>en-US</BrowserLanguage>
<SystemLanguage>en-GB</SystemLanguage>
<UserLanguage>en-US</UserLanguage>
<ScreenResolution>1422x800</ScreenResolution>
<ClientName>Web</ClientName>
<ClienState>Online</ClienState>
<ClientTime>2016-02-15T16:19:27</ClientTime>
</ClientInformation>
<ServerInformation>
<OrgLanguage>1033</OrgLanguage>
<OrgCulture>1033</OrgCulture>
<UserLanguage>1033</UserLanguage>
<UserCulture>1033</UserCulture>
<OrgID>{7C8E99C3-AEFC-4D78-B269-7435647DD1C6}</OrgID>
<UserID>{33AF6AE5-43C4-E511-80D9-5065F38A29E1}</UserID>
<CRMVersion>8.0.0.2091</CRMVersion>
</ServerInformation>
</CrmScriptErrorReport>
<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>Unable to get property 'firstChild' of undefined or null reference</Message>
<Line>0</Line>
<URL>/form/page.aspx?lcid=1033&themeId=8dbb98e6-a1a8-40ed-c83f-688767fb9a85&tstamp=627957&updateTimeStamp=635906496502128753&userts=131000265151606335&ver=-114056169#etc=2&extraqs=%3f_gridType%3d2%26etc%3d2%26id%3d%257b6DA6E5B9-88DF-E311-B8E5-6C3BE5A8B200%257d%26rskey%3d%257b00000000-0000-0000-00AA-000010001004%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b00000000-0000-0000-00AA-000010001004%7d&counter=1455553167284</URL>
<PageURL>/form/page.aspx?lcid=1033&themeId=8dbb98e6-a1a8-40ed-c83f-688767fb9a85&tstamp=627957&updateTimeStamp=635906496502128753&userts=131000265151606335&ver=-114056169#etc=2&extraqs=%3f_gridType%3d2%26etc%3d2%26id%3d%257b6DA6E5B9-88DF-E311-B8E5-6C3BE5A8B200%257d%26rskey%3d%257b00000000-0000-0000-00AA-000010001004%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b00000000-0000-0000-00AA-000010001004%7d&counter=1455553167284</PageURL>
<Function>anonymous(){var$v_0=this.$9H_1.toDictionary();var$$dict_3=$v_0;for(var$$key_4in$$dict_3){var$v_2={key:$$key_4,value:$$dict_3[$$key_4]};var$v_3=$v_2.value;if(!$v_3.$5p_2){$v_3.initialize();}}var$v_1=this.get_viewMap().toDictionary();var$$dict_9=$v_1;for(va</Function>
Before I go down the path of creating a new custom form from scratch to see if this resolves was hoping you could provide me with some pointers on where to start looking. Could it be down to some hardcoded GUID in the core JS SDK/JS web resources? I inherited the code from a previous contractor and just trying to figure out what are the possible causes for this behavior and where to take the investigation?
Thanks in Advance