Monday, 18 May 2015

Retrieve Entity Information from CRM 2011 Roll Up 12.

Hi,

Now we can retrieve entity information using a SDK method. i.e.. RetrieveEntityRequest

Here is the sample code of it.

RetrieveEntityRequest retrieveRequest = new RetrieveEntityRequest
{
      EntityFilters = EntityFilters.Entity,
      LogicalName = "entityname"
};
RetrieveEntityResponse retrieveEntityResponse = (RetrieveEntityResponse)objService.Execute(retrieveRequest);

EntityFilters is a enum. Here are the values of it.

Enum Description
All Use this to retrieve all data for an entity. Value = 15.
Attributes Use this to retrieve entity information plus attributes for the entity. Value = 2.
Default Use this to retrieve only entity information. Equivalent to EntityFilters.Entity. Value = 1.
Entity Use this to retrieve only entity information. Equivalent to EntityFilters.Default. Value = 1.
Privileges Use this to retrieve entity information plus privileges for the entity. Value = 4.
Relationships Use this to retrieve entity information plus entity relationships for the entity. Value = 8.

Hope this helps.

--
Happy CRM'ing
Gopinath.
 

No comments:

Post a Comment