How to put a couple of range in a single query data source

Hi All

qbds1 = q.addDataSource(tableNum(ProjCategory));

qbr1 = qbds1.addRange(fieldNum(ProjCategory, CategoryType));

// qbr1.value(SysQuery::value(categoryType));

I need two range so i used below line code rather above but it is not working.

qbr1.value(strfmt(’(categoryType == %1) && (categoryType == %2)’,any2int(ProjCategoryType::Item),any2int(ProjCategoryType::Cost)));

qbds2 = qbds1.addDataSource(tableNum(CategoryTable));



qbr2 = qbds2.addRange(fieldNum(CategoryTable, IcCategory));


so kindly let me know is there any way that in a single data source can i put couple of range filter .



What do you want to achieve? Your current code is logically wrong, because no category can be both Item and Cost in the same time.

If you want categories with type equal either Item or Cost, use two ranges:

qbds1.addRange(fieldNum(ProjCategory, CategoryType))
qbds1.addRange(fieldNum(ProjCategory, CategoryType))

Hi Martin Dráb

Thanks for your reply But i need both range should work .

In detail There is customized List page form look up with four field

If a customer choose the cost then Item && cost range will work in a single look up.

I am taking all data from Category Table , Range as Transaction Type and my Lookup is

Category Id and Name .

req. If Cost will selected then in the look up there are cost related category id and item related category id will select in a single field look up .

Kindly let me know how it will possible or not

if possible give me some hints .



If I understand what you want, I already gave you a solution in my previous answer. Have you tried it? What’s exactly works differently than expected?

Hi Martin ,

U r a Hero in Ax Thanks a lot .