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

Best Practices for Troubleshooting Application Issues in D365 and Power Platform

When facing application issues, it’s important to systematically troubleshoot before reaching out for support.  Follow these steps to ensure...