Hi,
While trying to retrieve more than 5000 records using Fetch XML we were getting the above error.
This is the sample code that we were using
http://msdn.microsoft.com/en-us/library/gg328046.aspx
it seems that the value of pagingcookie is not being set there in case of more records
// Check for morerecords, if it returns 1.
if (returnCollection.MoreRecords)
{
// Increment the page number to retrieve the next page.
pageNumber++;
}
Similar sample code for CRM 4
http://msdn.microsoft.com/en-us/library/cc151070.aspx
// Check for morerecords, if it returns true.
if (results.MoreRecords) {
// Increment the page number to retrieve the next page.
query.PageInfo.PageNumber++;
// Set the paging cookie to the paging cookie returned from current results.
query.PageInfo.PagingCookie = results.PagingCookie;
}
So setting the PagingCookie resolved the issue for us.
Bye.
Discover more from Nishant Rana's Weblog
Subscribe to get the latest posts sent to your email.
