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.
- IIS Reset
- Restarted the server
- 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