Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Issue with loading SavedView in an IFrame - Entity not found in Metadata

(0) ShareShare
ReportReport
Posted on by 54

Hi,

We recently migrated from CRM 4.0 to CRM 2013. There is a functionality where a saved view is loaded into an IFrame. When we use the same code, system throws a Query Builder error. Below is a sample of the code and details of the error.

We already performed the below steps, but still getting the same error.

  1. IIS Reset
  2. Restarted the server
  3. Created a new view and tried referencing with the new ID

Code:

var vDynamicForm = '<form name="vDynamicForm" method="post" action="/TMI/AdvancedFind/fetchData.aspx"?EntityCode=10013&QueryId="' + Instance.QueryId + '"&ViewType=1039">' +

'<input type="hidden" name="FetchXml" value="' + Instance.FetchXml + '">' +
'<input type="hidden" name="LayoutXml" value="' + Instance.LayoutXml + '">' +
'<input type="hidden" name="EntityName" value=' + Instance.Entity + '>' +
//'<input type="hidden" name="EntityCode" value=10013>' +
'<input type="hidden" name="DefaultAdvFindViewId" value=' + Instance.QueryId + '>' +
'<input type="hidden" name="ViewType" value="1039">' +

'</form>';

m_iframeDoc.body.innerHTML = vDynamicForm;
m_iframeDoc.vDynamicForm.submit();

Error Log:

Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.

Error Number: 0x80041102

Error Message: The entity with ObjectTypeCode = 0 was not found in the MetadataCache.

Error Details: The entity with ObjectTypeCode = 0 was not found in the MetadataCache.

Source File: Not available

Line Number: Not available

Request URL: xyz.com/.../fetchData.aspx

Stack Trace Info: [EntityMetadataNotFoundException: The entity with ObjectTypeCode = 0 was not found in the MetadataCache.]
at Microsoft.Crm.Metadata.DynamicMetadataCache.GetEntity(Int32 entityCode)
at Microsoft.Crm.Web.AdvancedFind.FetchData.SetGridColumns(String layoutXml, String fetchXml)
at Microsoft.Crm.Web.AdvancedFind.FetchData.ConfigurePage()
at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
at Microsoft.Crm.Application.Controls.PageManager.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

[HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


[2019-08-06 04:24:51.055] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 130 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Info |ReqId: db8e9941-78fa-4c41-917c-285ff700626a | FaultHelper.ConvertToFault ilOffset = 0x0
>TryConvertToFaultExceptionInternal: exception: System.Web.HttpUnhandledException
[2019-08-06 04:24:51.055] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 130 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Info |ReqId: db8e9941-78fa-4c41-917c-285ff700626a | ExceptionConverter.DumpExceptionRecursive ilOffset = 0x26D
>NestingDepth: 24
[2019-08-06 04:24:51.055] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 130 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Info |ReqId: db8e9941-78fa-4c41-917c-285ff700626a | ExceptionConverter.TryConvertToFaultExceptionInternal ilOffset = 0x2D
>----- dump exception/fault tree (TryConvertToFaultExceptionInternal: before) -----
>>>>>> EXCEPTION: 0
>Type: System.Web.HttpUnhandledException
>Message (65): Exception of type 'System.Web.HttpUnhandledException' was thrown.
>StackTrace: present: 0B6E8FC9
>no PluginTrace
>>>>>> EXCEPTION: 1
>Type: Microsoft.Crm.Metadata.EntityMetadataNotFoundException
>ErrorCode: 0x80041102:
>Message (70): The entity with ObjectTypeCode = 0 was not found in the MetadataCache.
>StackTrace: present: 1984B4B2
>no PluginTrace
>InnerException <null>
><<<<< EXCEPTION: 1

*This post is locked for comments

  • surajcs55 Profile Picture
    surajcs55 54 on at
    RE: Issue with loading SavedView in an IFrame - Entity not found in Metadata

    Anybody has a solution for this error?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans