Skip to main content

Posts

Showing posts from March, 2020

Adding AND condition between same fields in query using QueryBuilder in x++ in D365 | AX2012

Hello Devs! While working with multi value lookups and using it to exclude values we normally encounters this problem that the filter doesn't works properly and applies filter on any one value Scenario : while adding multiply value filter through " addRange()"  MS dynamics AX has out of the box functionality that it adds  OR  between the filter values so that is the reason our filter doesn't works properly and applies filter on any one value but this is the case when we use it for excluding values like it makes the expression like this WHERE ((NOT (InvoiceAccount = N'V000001')) OR (NOT (InvoiceAccount = N'V000002'))) where as we want it as this to apply the filter perfectly WHERE ((NOT (InvoiceAccount = N'V000001')) AND (NOT (InvoiceAccount = N'V000002'))) Solution:  1)We would be using either a regular table or a Temp table to inserting values in to it 2)The table should contain the same field on which we wants