Is it possible to limit the amount of results returned in a response when using a QueryExpression in CRM 4

£可爱£侵袭症+ 提交于 2019-11-29 13:34:01

In a QueryExpression:

QueryExpression query = new QueryExpression(); 
query.PageInfo = new PagingInfo();
query.PageInfo.Count = 200; // or 50, or whatever
query.PageInfo.PageNumber = 1;

In Fetch XML:

<fetch mapping='logical' page='1' count='200'>
...

@Matt basically said everything right. This article expands on his answer.

What you essentially want to do is use PageInfo prop of QueryExpression. That way you can limit the results, or, even better fetch more than 5000 rows (default limit). PageInfo is used as a paging indicator. How many rows does a page have, how many pages and most important, PagingCookie used for recursive read of more data (more than 5k rows) https://msdn.microsoft.com/en-us/library/mt269606.aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!