Tuesday 2 December 2014

Count number of records in a table in AX 2012

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)));
}

1 comment:

  1. thanks for this usefull article, waiting for this article like this again. word counter

    ReplyDelete

Calculate ledger balance by dimension set in X++ in AX2012/Dynamics 365 FO

There are a variety of ways users can view balances in the general ledger. Some of the most common options are: 1. Trial balance 2. Financia...