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, ...
Answered

useEnumValues property

(0) ShareShare
ReportReport
Posted on by 1,552

Hi, 

i noticed that some enums have UseEnumValues property set to yes/

1. what does this property do?

2. How can i enable this property when creating a new base enum? i can't find a way to enable it.

3. let's say i have this Enum called Enum1 (where the property is set to false)  and it has these three items: start,Middle,Finish

if this enum was used in AOT query and i wanted to do a range where status is less than finish

do i put in the range: <2     assuming start value is 0, middle is 1 and finish is 2  and is the syntax correct?

4. let's say i have this Enum called Enum3 (where the property is set to true)  and it has these 4 items: start,Middle,Finish,Done

starts has enumvalue 3, Middle has Enum value 7 , Finish has enum value 10 and Done has enum value 20

if this enum was used in AOT query and i wanted to do a range where status is less than finish

do i put in the range: <10 ? 

I have the same question (0)
  • Verified answer
    Blue Wang Profile Picture
    on at

    HI Junior,

    When you create a new BaseEnum, when you select IsExtensible as false, then UseEnumValues is Yes, otherwise it is No.

  • junior AX Profile Picture
    1,552 on at

    Hi Blue,

    Thank you. But why would i want to put enum values by myself and can u help me in answering Q3 and Q4?

  • Verified answer
    vinitgoyal2005 Profile Picture
    6,332 on at

    Hi,

    1 and 2 are answered.

    For 3: Yes you are correct, you need to put <2 and if you want a specific range then you can also use 1,2 (comma separated values).

    For4 : Also correct, you need to use <10 but there is no need to do this.

  • Blue Wang Profile Picture
    on at

    Hi Junior,

    When you use extensible enums in code(UseEnumValues=No), remember that extensible enums can't be used in comparisons.

    community.dynamics.com/.../d365foe-issue-with-enums-that-have-use-enum-value-property-set-to-no

  • Suggested answer
    Jeremy_Mounet Profile Picture
    170 on at

    Hi

    In my knowledge, when you extend a base enum, D365FO is managing the Enum Value assignation dynamically for new elements (done on SQL during synchronization in the EnumValueTable I guess, but not sure). That's why you can't use enum value if you use extension on the Base Enum.

    For me (but this is just my opinion), I prefer to use Enum code such as "Status::Complete" rather Enum Values, because the code will be extensible (if IsExtensible is set to yes) and more clear. Value using (hardcoded finally) is not a good practice in my knowledge, even on queries, because you could use multiple ranges to cover your requirement with a OR operator for instance.

    In your example 3, you could use a "!= Enum3::Done" to have all the other status.

    in your example 4, you could use value == Enum3::Start || value == Enum3::Middle as range.

  • junior AX Profile Picture
    1,552 on at

    Hi Vinit, Blue and jermy,

    Thanks alot all.,, and i'll use <Status::Finish instead of <10 

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
Martin Dráb Profile Picture

Martin Dráb 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans