OR Condition through Query Framework

OR condition in query framework here is a small example to achieve the same.

static void queryORCondtion(Args _args)
{
Query q;
Queryrun qr;
CustTable ct;

str range;
;

q = new query();
q.addDataSource(tablenum(CustTable));

range = strfmt(‘((%1 == "4000") || (%2 == "20"))’, fieldstr(CustTable, AccountNum), fieldstr(CustTable, CustGroup));
q.dataSourceNo(1).addRange(fieldNum(CustTable, AccountNum)).value(range);

qr = new QueryRun(q);
while (qr.next())
{
ct = qr.getNo(1);
info(ct.AccountNum);
}

info (qr.query().dataSourceNo(1).toString());
}

Comments

Popular posts from this blog

Dynamics Ax 2012 Interview Questions:

Oops concept in AX