Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

EntityFilters.Attributes took more time than EntityFilters.Entity to fetch entity metadata.

(0) ShareShare
ReportReport
Posted on by

Hi All,

I am using Dynamics CRM server 2016.

I want to find out alternate keys for all entities.

Please see two code snippet as below.

------------------------------------------------------------------------------------------------------------------

Code snippet [1].

RetrieveAllEntitiesRequest request = new RetrieveAllEntitiesRequest()
{
     EntityFilters = EntityFilters.Attributes,
     RetrieveAsIfPublished = true
};

RetrieveAllEntitiesResponse response = (RetrieveAllEntitiesResponse)serviceProxy.Execute(request);

------------------------------------------------------------------------------------------------------------------

Code snippet [2].

RetrieveAllEntitiesRequestrequest = new RetrieveAllEntitiesRequest()
{
    EntityFilters = EntityFilters.Entity ,
     RetrieveAsIfPublished = true
};

RetrieveAllEntitiesResponse response = (RetrieveAllEntitiesResponse)serviceProxy.Execute(request);

------------------------------------------------------------------------------------------------------------------

I observed that,

- By using Code snippet [2], server respond in very less time but did not retrieve  information for alternate keys.

- When i used Code snippet [1] , server took more time to respond and it successfully retrieved  information for alternate keys.

I want to know that, is there any way to find alternate keys for all entities in less time?

*This post is locked for comments

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: EntityFilters.Attributes took more time than EntityFilters.Entity to fetch entity metadata.

    Hi,

    Based on this article (msdn.microsoft.com/.../microsoft.xrm.sdk.metadata.entityfilters.aspx) you can't use filters in other way so you will have to use code from snippet 2.

    As alternative approach you can try using MetadataQuery - msdn.microsoft.com/.../jj863605.aspx

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans