Wednesday, June 29, 2011

To count total records from the customized query

Hi,
Below is the code to count the total no. of records using QueryRun.

        q = new Query();
        qbd = q.addDataSource(TableNum(BOMVersion));
        qbr = qbd.addRange(FieldNum(BOMVersion, ItemId));
        qbr.value("ELB008");
        qr = new QueryRun(q);
        info(strfmt("Total Record: %1", SysQuery::countTotal(qr)));

Thanks,
/Ashlesh

No comments:

Post a Comment