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

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...