前几天我在尝试在CRM中创建新实体时收到此错误。
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: There should be at least one metadata entity returned. Count: 0Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>There should be at least one metadata entity returned. Count: 0</Message>
<Timestamp>2016-04-27T20:13:29.801472Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>
<Message>The dependent component Attribute (Id=[AttributeId]) does not exist. Failure trying to associate it with RelationshipExtraCondition (Id=[RelationshipExtraConditionId]) as a dependency. Missing dependency lookup type = PrimaryKeyLookup.</Message>
在针对有类似问题的用户上网后,我仍然无法找到解决方案。对于少数用户,系统有一个表单或模板,它引用了一个不再存在的值,并从表单中删除或重新创建解决了问题。
我的理解是,如果在CRM 2011及更高版本的应用程序中仍然引用某个字段,我将无法从CRM中删除该字段。该消息表明引用的Attribute不存在,但是当我查询[MetadataSchema]。[Attribute]表时,它返回引用'ConcerObjectTypeCode'的结果。每当我尝试创建自定义实体时,似乎都会为RelationshipExtraCondition生成一个新的Guid。
我检查了服务器上的应用程序事件日志,并且没有记录此日志的记录。
有关我如何解决此问题的建议吗?
环境:CRM 2011 On Premise