Add range to builddatasource

I’m in AX 2012 R3 environment.I would like to add a query range to GeneralJournalEntry table and filter out rows that have a JournalCategory value different to LedgerTransType::Purch , i try this but it works for only one range:

datasource.addRange(fieldnum(GeneralJournalEntry,JournalCategory)).value(SysQuery::valueNot(LedgerTransType::Purch));

But what if i want add multiple value to range like this :

datasource.addRange(fieldnum(GeneralJournalEntry,JournalCategory)).value(SysQuery::valueNot(LedgerTransType::Sales));
datasource.addRange(fieldnum(GeneralJournalEntry,JournalCategory)).value(SysQuery::valueNot(LedgerTransType::Purch));

this not works!

Can you check this.

dynamicsuser.net/.../81711

this is the solution

datasource.addRange(fieldnum(GeneralJournalEntry,JournalCategory)).
value(strFmt(’((%1.%2 != %3) && (%1.%2 != %4))’, datasource.name(),
fieldStr(GeneralJournalEntry,JournalCategory),
any2int(LedgerTransType::Purch),any2int(LedgerTransType::Sales)
));