Sometimes CRM 2013 decides to give me the following error when opening an Order (and presents me with an empty page, but with the top navigation bar intact):
<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>Unable to get property 'ClientVariables' of undefined or null reference</Message>
<Line>2</Line>
<URL>/_common/JsProvider.ashx?ids=1959345455-451858892-1713948411-1279630416-1250882489-367493978-19173614-574022791-696891199-2007586035-1552783829&ver=-976933632</URL>
<PageURL>/main.aspx?etc=1088&extraqs=%3f_gridType%3d1088%26etc%3d1088%26id%3d%257b76EB6220-FB46-E311-93F3-00155D5752A9%257d%26rskey%3d674031362&pagemode=iframe&pagetype=entityrecord&rskey=674031362 </PageURL>
<Function>anonymous(){returnthis.get_$L_0().ClientVariables}</Function>
<CallStack>
<Function>anonymous(){returnthis.get_$L_0().ClientVariables}</Function>
</CallStack>
</ScriptErrorDetails>
<ClientInformation>
<BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C)</BrowserUserAgent>
<BrowserLanguage>en-US</BrowserLanguage>
<SystemLanguage>en-US</SystemLanguage>
<UserLanguage>en-US</UserLanguage>
<ScreenResolution>1920x1080</ScreenResolution>
<ClientName>Web</ClientName>
<ClientTime>2013-11-11T17:32:05</ClientTime>
</ClientInformation>
<ServerInformation>
<OrgLanguage>1033</OrgLanguage>
<OrgCulture>1043</OrgCulture>
<UserLanguage>1033</UserLanguage>
<UserCulture>1043</UserCulture>
<OrgID>{54131DE3-6D18-44FD-B4D0-0A9E87DA3E9D}</OrgID>
<UserID>{E369A31E-3446-E311-93F2-00155D5752A9}</UserID>
<CRMVersion>6.0.0.809</CRMVersion>
</ServerInformation>
</CrmScriptErrorReport>
This will keep on happening until I fiddle around with the cache or open another organisation. I'm still not sure what exactly resolves it. I do have custom code on the Order form but I often go days without getting the error. Any idea how I can try to locate the cause of this error and whether it has something to do with my custom code or whether its a bug in CRM 2013?
Thanks.