“Paging cookie is required when trying to retrieve a set of records on any high pages” error in CRM 2011.

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.



Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s