Reputation: 21
Is there a way to fetch relationship description in dynamics crm through C# ?
I have looked into OnetoManyMetadata object but could not find it anywhere.
Upvotes: 0
Views: 369
Reputation: 23310
https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.messages.retrieveentityrequest.aspx
var cl = new CrmServiceClient(...);
var q = new RetrieveEntityRequest {
EntityFilters = EntityFilters.Relationships,
LogicalName = "..."
};
var r = (cl.Execute(q) as RetrieveEntityResponse).EntityMetadata;
var OtM = r.OneToManyRelationships;
var MtM = r.ManyToManyRelationships;
var MtO = r.ManyToOneRelationships;
Upvotes: 1