Calling the GetValidReferencingEntitiesRequest method using MetadataService
Posted on 2011-04-25
In order to get a list of entities that you can set an email message regarding using the CRM Metadata webservice, thee is a method named GetValidReferencingEntitiesRequest.
GetValidReferencingEntitiesRequest vRequest = new GetValidReferencingEntitiesRequest();
vRequest.ReferencedEntityName = "Email";
GetValidReferencingEntitiesResponse vResponse = (GetValidReferencingEntitiesResponse)metadataSvc.Execute(vRequest);
When I run this, it returns about 70 entity names and takes about 16 seconds (ugh). When you start a new email activity in CRM and click the Regarding button, the list of eligable entities is only about 25 and it only takes 1 second.
Why the difference? Is there a different method I should be using?