CRM 2011 Trace error on saving Order - The entity with a name = 'new_customtestingentity' was not found in the MetadataCache

StackOverflow https://stackoverflow.com/questions/17141306

  •  31-05-2022
  •  | 
  •  

This is a puzzle!

When I convert CRM 2011 quotes to orders I can save the order record and use it as normal. However when I attempt to create a new Order when I click the Save button I get a dialog with 'A error occurred' and the record fails to save. The CRM trace is below but I can fathom what the problem is - I've never even created a entity called 'new_customtestingentity'

Things I've tried:- a) Renaming the statuscode fields to their original names (I had changed them previously) b) Disabling the onsave javascript event in the form c) Re-enabling the default ribbon menu (I had hidden some unused bussons previously)

Trace:

Crm Exception: Message: The entity with a name = 'new_customtestingentity' was not found in the MetadataCache., ErrorCode: -2147217150 [2013-06-17 10:09:36.345] Process: w3wp |Organization:d8e7913e-0f93-45b7-ad9d-6a48d10b0de3 |Thread: 33 |Category: Application |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5cb5f3d1-1f7d-437f-828e-94676987a567 | ErrorInformation.LogError ilOffset = 0x17

>MSCRM Error Report:

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

Error Message: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

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

Source File: Not available

Line Number: Not available

Stack Trace Info: [ArgumentException: Invalid state for this entity: salesorder: 0 Parameter name: state] at Microsoft.Crm.Application.Platform.EntityProxy.ConvertStateToNumber(String entityName, String state) at Microsoft.Crm.Application.Platform.AttributeCollection.CreateOptionSetValueFromValue(String name, Object value, AttributeType attributeType, String entityLogicalName) at Microsoft.Crm.Application.Platform.AttributeCollection.SetEntityProperty(Entity entity, String name, String childAttributeName, Object parentProperty, AttributeMetadata attributeMetadata, Object value, IOrganizationContext context) at Microsoft.Crm.Application.Platform.AttributeCollection.Insert(String name, Object value, Boolean throwIfKeyExists) at Microsoft.Crm.Application.Platform.EntityProxy.SetData(XmlNode entityElement) at Microsoft.Crm.Application.Forms.EndUserForm.RetrieveParametersForEventDefault() at Microsoft.Crm.Application.Forms.EndUserForm.Initialize(Entity entity) at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, FormDescriptor fd) at Microsoft.Crm.Application.Components.PageHandlers.SalesorderRecordPageHandler.ConfigureFormHandler() at Microsoft.Crm.Application.Components.PageHandlers.RecordPageHandler.ConfigureFormWrapper() at Microsoft.Crm.Application.Components.Utility.GenericEventProcessor.RaiseEvent(String eventName) 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.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

[2013-06-17 10:09:36.345] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 33 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5cb5f3d1-1f7d-437f-828e-94676987a567 | ExceptionConverter.ConvertToFault ilOffset = 0x57

UNEXPECTED: no fault? [2013-06-17 10:09:36.345] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 33 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5cb5f3d1-1f7d-437f-828e-94676987a567 | ExceptionConverter.ConvertMessageAndErrorCode ilOffset = 0x23B System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #5F67091F: System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentException: Invalid state for this entity: salesorder: 0 Parameter name: state at Microsoft.Crm.Application.Platform.EntityProxy.ConvertStateToNumber(String entityName, String state) at Microsoft.Crm.Application.Platform.AttributeCollection.CreateOptionSetValueFromValue(String name, Object value, AttributeType attributeType, String entityLogicalName) at Microsoft.Crm.Application.Platform.AttributeCollection.SetEntityProperty(Entity entity, String name, String childAttributeName, Object parentProperty, AttributeMetadata attributeMetadata, Object value, IOrganizationContext context) at Microsoft.Crm.Application.Platform.AttributeCollection.Insert(String name, Object value, Boolean throwIfKeyExists) at Microsoft.Crm.Application.Platform.EntityProxy.SetData(XmlNode entityElement) at Microsoft.Crm.Application.Forms.EndUserForm.RetrieveParametersForEventDefault() at Microsoft.Crm.Application.Forms.EndUserForm.Initialize(Entity entity) at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, FormDescriptor fd) at Microsoft.Crm.Application.Components.PageHandlers.SalesorderRecordPageHandler.ConfigureFormHandler() at Microsoft.Crm.Application.Components.PageHandlers.RecordPageHandler.ConfigureFormWrapper() at Microsoft.Crm.Application.Components.Utility.GenericEventProcessor.RaiseEvent(String eventName) 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) 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.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) [2013-06-17 10:09:36.345] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 33 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5cb5f3d1-1f7d-437f-828e-94676987a567 | ExceptionConverter.ConvertToFault ilOffset = 0x69 UNEXPECTED: no fault?

有帮助吗?

解决方案

Solved!

When debugging some status options I had added the field status to the CRM main form. Somehow this caused everything to fall over on saving.

After removing the field (it still appears in the footer as per default) it saves without problem.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top