dynamics-crm - CRM 4.0 在发布期间抛出异常

标签 dynamics-crm dynamics-crm-4

我正在尝试发布从另一个租户导入的帐户实体,并在跟踪日志中收到以下消息:

Error: Object reference not set to an instance of an object.
Error Message: Object reference not set to an instance of an object.
Source File: Not available
Line Number: Not available
Request URL: http://crm1.blablabl.com/tenant/AppWebServices/SystemCustomization.asmx
Stack Trace Info: [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.Metadata.UsageHelper.CheckForms(Guid attributeId, DynamicMetadataCache mdCache, ExecutionContext context)
   at Microsoft.Crm.Metadata.UsageHelper.GetAttributeUsageInfo(Guid attributeId, Guid relationshipId, DynamicMetadataCache mdCache, ExecutionContext context)
   at Microsoft.Crm.Metadata.UsageHelper.GetEntityUsageInfo(Guid entityId, DynamicMetadataCache mdCache, ExecutionContext context)
   at Microsoft.Crm.Metadata.EntityService.GetUsageInfo(Guid entityId, ExecutionContext context)
   at Microsoft.Crm.Metadata.EntityService.GetUsageInfo(Guid entityId)
   at Microsoft.Crm.Application.WebServices.SystemCustomization.EntityDelete.Execute(IUser user, Guid entityId)
   at Microsoft.Crm.Application.WebServices.SystemCustomization.SystemCustomization.DeleteEntity(Guid entityId)

最佳答案

找到了我自己的解决方案:

帐户代码的实体类型为 1 - 因此,如果您在 CRM 数据库上运行以下查询:

SELECT  * FROM [MYTENANT_MSCRM].[dbo].[OrganizationUIBase] where [ObjectTypeCode] = 1

您应该看到 2 行,分别代表已发布和未发布的表单定义。

这些表单都存在问题(是的,已发布的表单可能存在问题,这将阻止您发布有效的新表单)。您需要做的是查看每行中的 FormXml 字段,了解以下内容:

  • 包含不存在字段的单元格
  • 关系不再存在的单元

您也可以尝试排除法。一次删除一个单元格,使用相同的 FormXML 更新两条记录,然后再次尝试发布。

这可能需要一些时间,但这会解决您的问题。

关于dynamics-crm - CRM 4.0 在发布期间抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12862514/

相关文章:

c# - 在 CRM Dynamics 2011 中删除用户

dynamics-crm - MS CRM 4 - 具有 "regardingobjectid"功能的自定义实体

dynamics-crm - 如何将命令行 OrgDBOrgSettings 工具与 CRM Online 结合使用?

javascript - CRM:回复电子邮件时设置多个电子邮件地址的 Javascript

azure - 使用静态 token 连接到动态

dynamics-crm - 在 FetchXML 中返回 NULLS

plugins - 如何发布具有多个程序集的 Dynamics CRM4 插件?

dynamics-crm-2011 - 在执行冗长操作时显示微调器的默认且简单的方法

javascript - crm 2011 如何使用 javascript 隐藏/显示功能区按钮

dynamics-crm - Dynamics CRM - 夏令时