19 Nov 2013

count Records using X++ in Query + ax

Following code illustrates how we can use SysQuery::countTotal() method to get the number of records in Query.

static void Query_cntRecords(Args _args)
{
Query query = new Query();
QueryRun queryRun;
QueryBuildDataSource qbd;
;

qbd = query.addDataSource(tablenum(CustTable));
queryRun = new QueryRun(query);

info(strfmt("Total Records in Query %1",SysQuery::countTotal(queryRun)));

}

No comments:

Create number sequence in D365 FO

Create the data type. Add code in the loadModule method of the appropriate NumberSeqModule subclass. Add a method to the module’s paramet...