最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Dynamics 365财务和运营 在Query 中进行分页X ++ / Paging in Query X++ Dynamics 365 for finance and operations

网络文摘 alirazazaidi 1318浏览 0评论

For paging in X++ Query. There are three steps required. Rest of Query Code is same.

We have to set following things in Query data source

  • Set Sort field in Query data Source.
  • Paging position property of QueryRun is set to true.
  • Add page range with starting position and number of records in QueryRun

Here is code snippet

 
  QueryBuildRange qbr,qbrStartDate,qbrEndDate; QueryBuildDataSource qbd; IAPageSize EnumPageSize; QueryRun        qr; Query           query = new Query(); Int pageSize = 2;   qbd = query.addDataSource(TableNum(ProjPlanVersion)); qbd.addOrderByField(fieldNum(ProjPlanVersion,HierarchyId)); qr = new QueryRun(query); qr.enablePositionPaging(true);             CurrentPageNumber =1;             startingposition = CurrentPageNumber * pagesize;             qr.addPageRange(startingposition, totalRows); while(qr.next())   {   Info (“”); }
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址