How to fetch all CRM 2011 Related Entities given an entity
Is开发者_运维技巧 it possible to fetch all the CRM 2011 related entities given an entity? For example, Entity A have a one-to-many relationship with entity B,C, and D. Entity E have a one-to-many relationship with entity F and G.
I want to make a custom page in which there is a combobox in which people can choose the entity and it will show the related entities (If the user choose A, it will show B,C, and D). Any advise on how to achieve this?
Regards,
EntityMetadata metadata = ... // here you get the metadata of your entity
List<string> relations = new List<string>();
foreach (OneToManyMetadata oneToManyRelationship in metadata.OneToManyRelationships)
relations.Add(oneToManyRelationship.ReferencingEntity);
精彩评论