Tuesday, November 21, 2017

CREATE DYNAMIC QUERY IN AX X++ CODE ON THE FLY FILTER: DYNAMICS AX X++ CODE


CREATE DYNAMIC QUERY IN AX X++ CODE WITH FILTER

public void qUERYdYNAMICS()
{
    Query q;
    QueryRun qr;
    QueryBuildDataSource qbd;
    QueryBuildRange qbr;

    q = new Query();
    qbd = q.addDataSource(TableNum(CustTable));

    qbr = qbd.addRange(FieldNum(CustTable, AccountNum));
    qbr.value(">=4000"); // Default operator is ==.

    qbr = qbd.addRange(FieldNum(CustTable, AccountNum));
    qbr.value("<=4022");

    qbd.addSortField(FieldNum(CustTable, DlvMode));

    qr = new QueryRun(q);
    qr.prompt();

    pause;
}

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...