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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to get total aggregate records count if records is having more than 50000 records - for Online instance only

(0) ShareShare
ReportReport
Posted on by

Guys i would like to get total aggregate records count using fetch XML if records having more than 50,000 for online instance only, please suggest how to get.

I have tried using below fetch XML

<fetch distinct='false' mapping='logical' aggregate='true'>
<entity name='ma_externalactions'>
<attribute name='ma_externalactionsid' alias='ResultCount' aggregate='count'/>
</entity>
</fetch>

but i am getting error "Maximum limit is exceeded record. Reduce the number of records.
Table name: ma_externalactions

Available Records : 75000 +

Please suggest.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Bruno Lucas Profile Picture
    5,421 on at

    You may want to try paging

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

  • Ashish D Manatkar Profile Picture
    on at

    Bruno,

    I am talking about aggregate records count, i agree 5000 records get without aggregate fetch xml query.

  • Suggested answer
    Bruno Lucas Profile Picture
    5,421 on at

    I see,

    there is this setting

    social.technet.microsoft.com/.../12601.crm-2011-timeouts-and-limits.aspx

    msdn.microsoft.com/.../gg328128.aspx

    but note the  message "You should use the advanced settings only when indicated to do so by the Microsoft Dynamics CRM customer support representatives."

    this is probably change this on the database

    paul-way.com/crm-2013-aggregate-query-record-limit-exceeded

    it may affect performance.

  • Ashish D Manatkar Profile Picture
    on at

    Bruno,

    This settings only for On-Premises instance.  I am looking for online instance.

  • Suggested answer
    Bruno Lucas Profile Picture
    5,421 on at

    For online there is no way to remove the 50000 limit for aggregate

    www.linkedin.com/.../Possible-limitation-in-MS-CRM-21231.S.269446834

    I don't know what you are trying to accomplish, but if you just need to count a field you can use my first suggestion and simulate the "count" inside the loop.

    otherwise you will need to have something to pull the data to another database where you can use SQL

  • Ashish D Manatkar Profile Picture
    on at

    According your first reply we are getting data which i don't want, i just want the count of records nothing else. I don't want to retrieve data and count inside the loop.

  • Community Member Profile Picture
    on at

    It is pretty painful to get a record count on an entity.  I ended up building a web resource that lists out all the entities in the org, then pages over them counting each page.  It works, but for an entity that contains around 800,000 records it takes 2-3 minutes to page the entire table not to mention I'm bringing back several megs of data when all I want is a number.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans