web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)
Answered

FetchXML get total count of record

(0) ShareShare
ReportReport
Posted on by 2,510

Hi, by default, Fetchxml gets 5000 results, what if the result is after 5000, I have to call multiple times? 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Hi

    You would have to use paging cookie.

    Please refer the following:

    https://msdn.microsoft.com/en-us/library/gg328046.aspx

  • sdnd2000 Profile Picture
    2,510 on at

    The link doesn't work

  • Brekh Profile Picture
    192 on at

    Hi,

    You can check for Morerecords property from the resultset of Entity collection and use pagingCookie. Below link shows the example.

    stackoverflow.com/.../how-to-fetch-more-than-5000-entities-from-crm

    Hope this helps.

  • Suggested answer
    Thomas David Dayman Profile Picture
    11,323 on at

    If you download XRMToolBox and download the Record Counter plugin :)

    5775.Screenshot_5F00_2.png

  • Gopalan Bhuvanesh Profile Picture
    11,401 on at

    msdn.microsoft.com/.../gg328046.aspx

  • Suggested answer
    BadrinathB Profile Picture
    970 on at

    What is your exact requirement?

    If you have to fetch more than 5k records then you can use either paging concept or update system settings to fetch more record.

    The below link will help you to understand better.

    www.softchief.com/.../retrieve-more-than-5000-records-in-dynamics-crm

  • sdnd2000 Profile Picture
    2,510 on at

    I can use linq to retrieve all records?

  • ashlega Profile Picture
    34,477 on at

    You can use a paging cookie with Fetch (that link Gopalan provided seems to work fine.. at least today)

    You can use Linq, just keep in mind it'll work slightly differently - I believe it will try to grab all records at once, so this may take a while if you have too many. Also, it will be retrieving all entity attributes (unlike fetch where you can specify which exactly)

  • sdnd2000 Profile Picture
    2,510 on at

    yes, I understand, I have to use earlybound

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    You can do it with latebound (if we are talking about linq), just need to follow a workaround descrbied here:

    community.dynamics.com/.../querying-crm-data-with-linq

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Varsha deshpande Profile Picture

Varsha deshpande 5

#2
NeerajPawar Profile Picture

NeerajPawar 2

#2
jlattimer Profile Picture

jlattimer 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans