Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

How to get a list of Entities having relationship with Activities (Email, Phone Call, Appointment, etc)

$
0
0

Hello All,

I want to retrieve list of all entities having relationship with Activities. 

I have gone through the below code,

RetrieveAllEntitiesRequest req = new RetrieveAllEntitiesRequest();
req.EntityFilters = EntityFilters.Entity;
req.RetrieveAsIfPublished = true;

RetrieveAllEntitiesResponse response = (RetrieveAllEntitiesResponse) service.Execute(req);
List<string> list = new List<string>();

foreach (var item in response.EntityMetadata)
{
list.Add(item.LogicalName.ToUpper() + " " + item.DisplayName.ToString().ToUpper());
}

list.Sort();

But above code shows all the entities present in MS CRM 2015. 
I have a requirement where I have to show "List of entities " in dropdown who has relationship with Activities. I have tried using "IsActivityParty" property of an entity but it won't include my Custom Entities.
Your help is appreciated.

Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>