我正在尝试发布从另一个租户导入的帐户实体,并在跟踪日志中收到以下消息:
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/