Reputation: 414
Is it possible to view all mappings of entities in a Dynamic CRM 2011 solution? I know I can view them by entity from the "Customize the System" section, but wanted to know if by some chance they are stored in a particular part of the database. I looked through several MS documents but nothing pointed me to what we're needing. I need this so I can (hopefully) create a diagram of the relationships.
Upvotes: 0
Views: 2847
Reputation: 241
Here is the link for Entity Relationship Diagram released by MS. http://www.microsoft.com/en-us/download/details.aspx?id=2640
Upvotes: 0
Reputation: 1718
Check out the Relationship table:
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
Upvotes: 1