Wednesday, September 5, 2018

Query LIMIT (enablePositionPaging, addPageRange)

static void QueryPagingOptionCheck(Args _args)
{
     Query query = new Query();
     QueryBuildDataSource qbds;
     QueryRun queryRun;
     CustTable custTable;
    qbds = query.addDataSource(tablenum(CustTable));  
    qbds.addOrderByField(fieldnum(CustTable, AccountNum));
   queryRun= new QueryRun(Query);
   queryRun.literals(true);
    queryRun.enablePositionPaging(true);
    queryRun.addPageRange(100,120);
    while (queryRun.next())
    {
         custTable= queryRun.getNo(1);
         info(strFmt("% 1 - :", custTable.AccountNum,custTable.name()));
    }
}

No comments:

Post a Comment

Search hierarchy for a match (TableALLGroup) X++

  Table1 ppt;  select firstonly ppt  order ItemCode, ItemRelation, AccountCode, AccountRelation where      (ppt.ItemCode == TableGroupAll::T...