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,550

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? 

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Query range in AOT for enums

    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?

  • Sergei Minozhenko Profile Picture
    23,091 on at
    RE: Query range in AOT for enums

    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.

  • junior AX Profile Picture
    1,550 on at
    RE: Query range in AOT for enums

    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?

  • junior AX Profile Picture
    1,550 on at
    RE: Query range in AOT for enums

    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?

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,091 on at
    RE: Query range in AOT for enums

    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.

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Query range in AOT for enums

    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.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,140 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,895 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans