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

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...