Hi,
There are 5000 records limitation for Fetch XML on lookup , we have this requirement how to over come this limitation in D365 please help if someone have solved this in past.
Regards
Kusum
Hello,
refer this articles,
http://www.kingswaysoft.com/blog/2013/06/18/Limitations-with-CRM-FetchXML
https://www.xspdf.com/resolution/52737866.html
I hope it helps,
Thanks.
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365
Hi Kusum,
The whole story and solution is here : pravinpawarweb.wordpress.com/.../
With the help of "PagingCookie" you can retrieve more than 5000 records using fetchexpression
Dear Partner,
QueryExpression in CRM returns only up to 5000 records only. If you want to retrieve the entity records count that has more than 5000 records then need to use FetchExpression. Fetch expression uses the fetch XML query with aggregate operator.
Below is the same code to retrieve the records count from Account:
string fetch = @”<fetch mapping=’logical’ distinct=’false’ aggregate=’true’>
<entity name=’contact’>
<attribute name=’contactid’ alias=’recordcount’ aggregate=’count’/>
</entity>
</fetch>”;
FetchExpression fetchquery = new FetchExpression(fetch);
var collection= CrmOrganizationService.RetrieveMultiple(fetchquery);
Note:
FetXML query returns up to 50000 records only. If we have more than 50K records then need to use paging concept to get all records count.
Did I answer your question? Please consider to mark my post as a solution to help others.
Regards,
Mohamed Sanuj Basheer
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,900 Super User 2024 Season 2
Martin Dráb 229,275 Most Valuable Professional
nmaenpaa 101,156