Dynamic 365分页查询
解决多行查询只能查询5000条的问题:
主要是加了一个do while循环,就可以一直查询下去
EntityCollection ec = null;
int pageNumber = 1;
do
{
QueryExpression query = new QueryExpression("Table");
query.ColumnSet = new ColumnSet("new_name");
query.PageInfo = new PagingInfo();
query.PageInfo.Count = 5000;//查询行数
query.PageInfo.PagingCookie = (pageNumber == 1) ? null : ec.PagingCookie;
query.PageInfo.PageNumber = pageNumber++;
query.Criteria.AddCondition("new_name", ConditionOperator.NotNull);
ec = serviceAdmin.RetrieveMultiple(query);
if (ec != null && ec.Entities.Count>0)
{
//逻辑
}
} while (ec != null && ec.MoreRecords);
————————————————
版权声明:本文为CSDN博主「火土水」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_60521457/article/details/126078192