Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Strange behaviour while setting filters on standard forms...

(0) ShareShare
ReportReport
Posted on by 1,085

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

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Strange behaviour while setting filters on standard forms...

    !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".

  • vv1984 Profile Picture
    vv1984 1,085 on at
    RE: Strange behaviour while setting filters on standard forms...

    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

  • Suggested answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Strange behaviour while setting filters on standard forms...

    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 !

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,784 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,476 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans