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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Query range in AOT for enums

(0) ShareShare
ReportReport
Posted on by 1,552

Hi,

I created an enum with multiple values where this enum is used in a table.

I created a query with this table and i put a range in the value property  MyEnum::Value2 and  i didn't get anything however when i put in the value property 2, i got the result correctly. Why is that? 

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

    Hi,

    You can put "Value2" in the query range value and it should work as well. You need to mention the actual value and not the enum type

    The MyEnum::Value2 probably has the  "enum value"  2 which is why it worked for you.

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

    Hi JuniorAX,

    You can use enum value (2) or enum symbol (Value2, but not MyEnum::Value2). Using enum symbol is the recommended way for extensible enums.

  • junior AX Profile Picture
    1,552 on at

    Hi Gunjan,

    yeah it has the same value. Which is better to put the value or the number?

    but i once created a view and put a range on the field and filled the value property with <MyEnum::Finish  and it worked, so what makes that different?

  • junior AX Profile Picture
    1,552 on at

    Hi Sergie,

    Thanks but as i mentioned in my previous reply, is that i once created a view and put a range on the field and filled the value property with <MyEnum::Finish  and it worked, so what makes that different?

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi, Junior_AX,

    So you mean that MyEnum::Value2 didn't work, by MyEnum::Finish works?

    Anyway, recommended way is to use the enum symbol (Finish), instead of the enum value. In case if you decide to re-number values in enum (it's rare case, but anyway it's possible) you don't need to fix ranges in queries. For extensible enums you will get BP warning about using enum symbol.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi,

    Using the name is the common practice. For an example, in SalesTableListPage query, the range ReturnStatus has values provided with Enum names -

    pastedimage1599989136576v1.png

    I have not tried putting the whole value of the Enum in a query. Could you share a screenshot of what you did in the view?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans