AX – D365FO – Count records in Query #d365fo

If your query has just one datasource you can use SysQuery::countTotal static void CountProjTableRecords(Args _args) { Query query = new Query(); QueryRun queryRun; QueryBuildDataSource qbd; qbd = query.addDataSource(tablenum(ProjTable)); queryRun = new QueryRun(query); info(strfmt("Total Records in Query %1", SysQuery::countTotal(queryRun))); // total records 1130 } If we need to count number of records of a query with … Continue reading AX – D365FO – Count records in Query #d365fo

AX – D365FO – Using SysQuery functions / methods with QueryBuildRange

Instead of direct assignment of the values to the query build range value, we can use SysQuery class methods to avoid the errors of datatype conversion. So here in this post I gave some useful methods. QueryBuildRange qbr; ---To set the value we usually follow as below mentioned code qbr.value(“Our Value”); qbr.value(queryValue(“Our Value”)); --We can set the value using … Continue reading AX – D365FO – Using SysQuery functions / methods with QueryBuildRange