Random Musings

June 5, 2009

Paging records using Dynamics CRM SDK QueryExpression

Filed under: Dynamics CRM — haditeo @ 9:55 pm
Tags: ,

Inside the QueryExpression object, we can set the PageInfo property to limit the number of records returned by the QueryExpression.

Just setup a PagingInfo object and set the PageInfo property of the QueryExpression to the PagingInfo object

PagingInfo page = new PagingInfo();
page.Count = 10; // means that we would like to return 10 records per batch
page.PageNumber = 2; // means that we would like to retrieve the 2nd batch which is record number 11 until 20

QueryExpression query = new QueryExpression;
query.PageInfo = page;
Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

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

Create a free website or blog at WordPress.com.

%d bloggers like this: