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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

AOT View Ranges: 'OR' operator in Value

(0) ShareShare
ReportReport
Posted on by

Hello,

I have a simple aot view created. The datasource is InventTrans.

I want to filter it with StatusIssue enum field.

If I have StatusIssue field in Ranges and I type StatusIssue::Sold, the values are filtered correctly.

Now I wanted to add another filter, so I have type StatusIssue::Sold || StatusIssue::Deducted. In this case it does not show anything at all, the view is empty.

How can I do that?

So, actually this what I want to have in View:

select * from InventTrans
    where   InventTrans.StatusIssue == StatusIssue::Sold ||
            InventTrans.StatusIssue == StatusIssue::Deducted;

I have the same question (0)
  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi DaxDev,

    Have you tried specifying the range value like this - Sold,Deducted ?

    You don't need to mention the Enum name. You need the values only

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,095 on at

    Hi DaxDev,

    You need to comma to separate value in "or" expression.

    Check docs

    docs.microsoft.com/.../how-to-create-queries-by-using-the-aot

  • DAX Dev Profile Picture
    on at

    Hi Sergei,

    Thanks,

    How should I do it if I want AND (&&) expression?

    For example if I add InventTransOrigin to InventTrans datasource and I want to filter it with

    !InventTransType::TransferOrderReceive && !InventTransType::TransferOrderShip

    Should I use comma also here?

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi DaxDev,

    In your case, an InventTrans record can have one StatusReceipt value. So, I am not sure how you will do an 'AND" join. An "AND" join can come into picture if you add another field into the query range.

    The "," operator will work for the values you are looking to retrieve.

  • DAX Dev Profile Picture
    on at

    Hi Gunjan,

    I mentioned InventTransOrigin. There I want to use 'AND' for the ReferenceCategory field.

    So I will add ReferenceCategory twice in Ranges

  • Sergei Minozhenko Profile Picture
    23,095 on at

    Hi DAXDev,

    You can check if example from docs  working.

    A..D, !C

    Finds A, B, and D.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi DaxDev,

    For InventTransOrigin, can a record have two values for the field InventTransType? You are essentially including InventTransOrigin records where the InventTransType value is not equal to TransferOrderReceive OR not equal to TransferOrderShip.

    You don't have an '&&" condition here. The query value should be "!TransferOrderReceive , !TransferOrderShip

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi DaxDev,

    As an example, you can check the query SalesTableListPageOpen which has a range on "ReturnStatus" field which can't be Canceled OR Created.

    pastedimage1601401648157v1.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 738

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 453 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 286 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans