Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Script error when you enter data in a lookup field in Microsoft Dynamics CRM 2011: “this.$E_2.contentWindow.document.body' is null or not an object”


View products that this article applies to.

Symptoms

When you enter data in a lookup field that has the automatic resolution and most recently used items functionality enabled, you receive a script error when you tab off the field allowing automatic resolution to choose a most recently used value. When you expand the script error, you may see a detailed script error similiar to the following, referencing MRU fields or InnerHTML:



<CrmScriptErrorReport>

  <ReportVersion>1.0</ReportVersion>

  <ScriptErrorDetails>

<Message>'this.$E_2.contentWindow.document.body' is null or not an object</Message>

 <Line>6</Line>

 <URL>/_common/global.ashx?ver=1810813519</URL>

 <PageURL>/userdefined/edit.aspx?etc=2&pagemode=iframe&sitemappath=Workplace%7cCustomers%7cnav_search</PageURL>





  <CrmScriptErrorReport>

  <ReportVersion>1.0</ReportVersion>

  <ScriptErrorDetails>

   <Message>Unable to set value of the property 'innerHTML': object is null or undefined</Message>

   <Line>6</Line>

   <URL>/_common/global.ashx?ver=-1915844570</URL>

   <PageURL>/userdefined/edit.aspx?

↑ Back to the top


Cause

This occurs when tabbing off the field or saving the form before the most recently used values have finished populating

↑ Back to the top


Resolution


The current workarounds are listed below:

Option 1:


1. Instead of entering characters in the field to use the most recently used values, click on the lookup button to select the record in the Look Up Record window


Option 2:

1. In Microsoft Dynamics CRM, point to Settings, point to Customization, and then click Customize the System.     

2. Expand the entity in question, and then click Forms.     

3. Double-click the form so the form customization window opens.     

4. Find the lookup field causing the issue, and then double-click to open.

5. Under Field Behavior, mark Turn off automatic resolution in the field and Disable most recently used items for this field.



Option 3: (Note This option will send all script error reports to Microsoft automatically and will prevent any future Microsoft Dynamics CRM script errors from being displayed)


For Individual users:


1. In Microsoft Dynamics CRM, point to File, point to Options, and then click Privacy.

2. Select Automatically send an error report to Microsoft without asking me for permission

3. This will stop the script error from occurring in this situation.



For Organization level:

1. In Microsoft Dynamics CRM, click Settings, click Administration, and then click Privacy Settings.

2. Select the Error Reporting tab.

3. Click to mark the Specify the Web Application error notification preferences on behalf of users checkbox.

4. Select Automatically send an error report to Microsoft without asking me for permission, and then click OK.

↑ Back to the top


More Information

 <CallStack>

<Function>if(IsNull(this.$E_2)||IsNull(this.$E_2.parentNode))return;this.$E_2.contentWindow.document.body.innerHTML="";this.$E_2.parentNode.removeChild(this.$E_2);this.$E_2=null</Function>

<Function>(callback)</Function>

<Function>(callback)</Function>

<Function>function(){this.$D_0="";if(!IsNull(Mscrm.LookupMruListUI.$0_0)){Mscrm.LookupMruListUI.$0_0.clear();Mscrm.LookupMruListUI.$0_0.hide()}if(!IsNull(Mscrm.LookupMruListUI.$7_0)){Mscrm.LookupMruListUI.$7_0.clear();Mscrm.LookupMruListUI.$7_0.hide()}}</Function>

<Function>function(){this.$V_0()}</Function>

<Function>hideMruInternal()</Function>

</CallStack>

</ScriptErrorDetails>

<ClientInformation>

<BrowserUserAgent>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; AskTbORJ/5.13.1.18107; InfoPath.3)</BrowserUserAgent>

<BrowserLanguage>en-us</BrowserLanguage>

<SystemLanguage>en-us</SystemLanguage>

<UserLanguage>en-us</UserLanguage>

<ScreenResolution>1440x900</ScreenResolution>

<ClientName>Web</ClientName>

<ClientTime>2012-01-26T13:01:56</ClientTime>

</ClientInformation>

<ServerInformation>

<OrgLanguage>1033</OrgLanguage>

<OrgCulture>1033</OrgCulture>

<UserLanguage>1033</UserLanguage>

<UserCulture>1033</UserCulture>

<CRMVersion>5.0.9688.594</CRMVersion>

</ServerInformation>

</CrmScriptErrorReport>

↑ Back to the top


Keywords: kbmbspartner, kbmbsmigrate, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 2671694
Revision : 1
Created on : 1/7/2017
Published on : 3/20/2012
Exists online : False
Views : 226