AX – D365FO – “OR” conditions in a QueryBuildRange for a same field

I want to add a list of values in an “OR” Condition for a same field in a QueryBuildRange.

The result must be something like that

select * from CustGroup where custGroup.CustGroup == ’50’ || custGroup.Group ==’90’;

To do that Just add range and assign value on the same field multiple times as shown in code below:

Query                   q;
QueryBuildDataSource    qbds;
QueryRun                qr;
QueryBuildRange         qbr;

q = new Query();
qbds = q.addDataSource(tableNum(CustGroup));
qbr = qbds.addRange(fieldNum(CustGroup,CustGroup));

qbr = qbds.addRange(fieldNum(CustGroup,CustGroup));


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s