查看Dynamic CRM 2011中的所有实体关系

时间:2014-04-30 15:58:27

标签: dynamics-crm-2011

是否可以在Dynamic CRM 2011解决方案中查看实体的所有映射?我知道我可以通过实体从“自定义系统”部分查看它们,但想知道它们是否存储在数据库的特定部分中。我浏览了几篇MS文档,但没有任何东西指向我们需要的东西。我需要这个,所以我可以(希望)创建一个关系图。

2 个答案:

答案 0 :(得分:1)

查看关系表:

select relationship.Name, SecondaryEntity = referencing.Name, LookupField = referencingAttribute.Name, PrimaryEntity = referenced.name, PrimaryEntityKey = referencedAttribute.Name, relationship.* 
from [Database]..RelationshipView relationship
join [Database]..EntityView referencing on relationship.ReferencingEntityId = referencing.EntityId
join [Database]..EntityView referenced on relationship.ReferencedEntityId = referenced.EntityId
join [Database]..AttributeView referencingAttribute on relationship.ReferencingAttributeId = referencingAttribute.AttributeId
join [Database]..AttributeView referencedAttribute on relationship.ReferencedAttributeId = referencedAttribute.AttributeId
--where SolutionId in ()    --Filter by the solution(s) you are interested in 

答案 1 :(得分:0)

这是MS发布的实体关系图的链接。 http://www.microsoft.com/en-us/download/details.aspx?id=2640