Article ID: 947096 - Last Review: April 14, 2008 - Revision: 2.0

Error message when you export or delete entities in Microsoft Dynamics CRM 4.0: "An unhandled exception occurred during the execution of the current web request"

Expand all | Collapse all

SYMPTOMS

When you export or delete entities in Microsoft Dynamics CRM 4.0, you receive the following 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.

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

Stack trace:
[NullReferenceException: Object reference not set to an instance of an object.] at Microsoft.Crm.ObjectModel.OrganizationUIService.LabelLoaderAllLanguages.LoadMetadataLabel(Int32 entityType, String attributeName, ExecutionContext context) at Microsoft.Crm.ObjectModel.OrganizationUIService.LabelLoader.LoadCellLabel(Guid cellObjectId, String cellObjectColumnName, Int32 objectType, String attributeName, ExecutionContext context) at
Microsoft.Crm.ObjectModel.OrganizationUIService.InsertFormLabels(IBusinessEntity entity, ILabelLoader labelLoader, ExecutionContext context) at
Microsoft.Crm.ObjectModel.OrganizationUIService.RetrieveMultipleWithAllLanguages(EntityExpression entityExpression, ExecutionContext context) at Microsoft.Crm.Metadata.OrganizationUIHelper.RetrieveInProductionHelper(Int32 objectTypeCode, ExecutionContext context) at Microsoft.Crm.Tools.ImportExportPublish.FormXmlHandler.ExportItem(XmlDocument importDocument) at Microsoft.Crm.Tools.ImportExportPublish.ExportHandler.Export(XmlDocument XDoc) at Microsoft.Crm.Tools.ImportExportPublish.ExportHandler.Export(XmlDocument XDoc) at Microsoft.Crm.Tools.ImportExportPublish.RootExportHandler.RunExport(String[] ExportEntities, String[] ExportRoles, String[] ExportWorkflows, ExportMask Mask) at Microsoft.Crm.Tools.ImportExportPublish.ExportXml.RunExport(String xmlArgs, XmlDocument& ExportDoc) at Microsoft.Crm.WebServices.ExportXmlService.ExportCompressed(String entities, String embeddedFileName, ExecutionContext context) [TargetInvocationException: Exception has been thrown by the target of an invocation.] at
Microsoft.Crm.Application.Utility.Util.RaiseXMLError(Exception exception) at Microsoft.Crm.Dialogs.ExportCustomizationsPage.ConfigureForm() at
Microsoft.Crm.Application.Controls.AppUIPage.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.ProcessRequestWithNoAssert(HttpContext context) at
System.Web.UI.Page.ProcessRequest(HttpContext context) at
ASP.orgname__grid_cmds_dlg_exportcustomizations_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

CAUSE

This problem occurs for one of the following reasons:
  • An entity form has an attribute that does not exist.
  • A primary entity of a parental relationship is exported later. When a parental relationship is created between two entities, the relationship attribute is added to the related entity. If only the primary entity is exported and then imported into a new environment, the import is successful. However, if the primary entity is exported later, the relationship does not exist.

RESOLUTION

To resolve this problem, turn on platform tracing during the export process, find the entity that causes the problem, and then delete the relationship attribute that exists on the form of the entity that is being exported. To do this, follow these steps:
  1. Find the entity that causes the problem. To do this, follow these steps:
    1. In Microsoft Dynamics CRM, turn on platform tracing. To do this, use the method that is described in Microsoft Knowledge Base article 907490. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
      907490  (http://support.microsoft.com/kb/907490/ ) How to enable tracing in Microsoft Dynamics CRM
    2. Export the Microsoft Dynamics CRM customizations.

      Note When you export the customizations, the platform trace points to the entity that causes the problem.
    3. View the error message in the platform trace file to find the entity that causes the problem.
  2. Find the attribute that causes the problem. To do this, use the appropriate method.

    Note The error message in the platform trace file does not display the exact attribute that causes the problem.
    • Open the Form editor, and then find the attribute that causes the problem. To do this, use one of the following methods:
      • Look for an attribute that is missing a label.
      • Look for an attribute the properties of which have only the Name value and do not have the Display Name value or the Description value.
    • Create a new record for the entity that you found, and then find the attribute that causes the problem.

      Note If the Dev Errors value is set to "On" in the Web.config file, you may receive an error message that resembles the following:
      Error Description:
      'Entity_name' entity does not contain attribute that has Name = 'Attribute_name'.
      Note In this error message, Attribute_name is a placeholder for the actual name of the attribute that you are trying to find.
  3. Create a temporary attribute that uses the same name as the attribute in the entity form.
  4. If the attribute is not required for the deployment, follow these steps:
    1. Delete the attribute from the entity form.
    2. Publish the entity.
    3. Delete the temporary attribute.

APPLIES TO
  • Microsoft Dynamics CRM 4.0
Keywords: 
kberrmsg kbmbscustomization kbexpertisebeginner kbtshoot kbmbsmigrate kbprb kbexpertiseinter KB947096
 

Article Translations

 

Related Support Centers