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 the filter to be applied
3)Adding a NoExitsJoin to our created table with the main data source
here I have written the piece of code to achieve this
Note: Here qbdsCMTInvoiceAccExcludeTMP is of QueryBuildDataSource type
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 the filter to be applied
3)Adding a NoExitsJoin to our created table with the main data source
here I have written the piece of code to achieve this
Note: Here qbdsCMTInvoiceAccExcludeTMP is of QueryBuildDataSource type
Comments
Post a Comment