web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Strange behaviour while setting filters on standard forms...

(0) ShareShare
ReportReport
Posted on by 1,087

Hi,

i've just noticed this unexpected behaviour when setting a filter on Ax standard forms (same when using queries and advanced filtering).

Let's say for instance we have a table with these records:

AA1,AA2,BB1,BB2

If we set the filter BB*,!BB1 the result will be:

BB2

If we set the filter !BB1,BB* instead, the result is the whole table:

AA1,AA2,BB1,BB2


Is this really an unexpected behaviour or am i missing something concerning boolean operations?

Thanks in advance

regards

*This post is locked for comments

  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    Hi win32,

    When you do !BB1,BB* where clause is  ( NOT (FIELD = BB1) OR (FIELD LIKE BB* )) so will return you everything.

    For BB*,!BB1  you will get (FIELD LIKE BB*) AND  NOT ((FIELD = BB1))

    It's surprising but order really meters !

  • vv1984 Profile Picture
    1,087 on at

    Looks like in the first statement the comma means OR while in the second one it means AND.

    I really find it hard to understand..

    Common sense always told me to write BB*,!BB1 but a user went to me asking why !BB1,BB* has another meaning and i really can't understand the very reason.

    Could you try explain it to me in other terms?

    Thank you very much indeed

    regards

  • Mea_ Profile Picture
    60,286 on at

    !BB1,BB* is treated by ax like " select everything that is NOT BB1 OR select everything that is LIKE BB*.

    AA1 is not BB1 so it is shown

    AA2 is not BB1 so it is shown

    BB1 is like BB* so it is shown

    BB2 is not BB1 so it is shown

    for BB*,!BB1  select everything that is like BB*  AND  NOT BB1

    AA1 is not like BB* skipped

    AA2 is not like BB* skipped

    BB1 is like BB* but it is BB1 so skipped

    BB2 is like BB* and not BB1 so is shown

    However I have no idea why AX generates this statement base on order, and was not able to find any documentation, so it probably not a bug but a "feature".

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans