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

NoYes Enum gets an empty value

(0) ShareShare
ReportReport
Posted on by 15

Hello people, 

I have a field in a table which extends EDT NoYesId (which extends Enum NoYes). 

I have a form with some records of this table and the tick is present in the corresponding field checkbox. 

When I run through these records using x++ and showed the value of the field in the infolog, it gave me just a blank result. 

When I looked directly in SQL database, I found the value of 255. 

Somehow, as I understand, the maximal SQL datatype tinyint value has been assigned. 

Any ideas what could be the reason of it? 

Thanks

I have the same question (0)
  • Martin Dráb Profile Picture
    239,242 Most Valuable Professional on at

    I don't know how you got into this situation, but your database contains invalid data. The valid values are 0 (No) and 1 (Yes); 255 doesn't belong to this enum.

  • edgcibu Profile Picture
    15 on at

    Isn't it that every enum can get up to 256 values what corresponds to sql tinyint datatype (even if it is system enum NoYes)? and we just define in Ax how many of them to use

  • Blue Wang Profile Picture
    Microsoft Employee on at

    HI Edgcibu,

    Are you getting the value through code?

    Maybe this will help:

    community.dynamics.com/.../enum-noyes-type-has-wrong-value

  • Martin Dráb Profile Picture
    239,242 Most Valuable Professional on at

    No, you confuse enums with the underlaying type (integer). The only valid values of an enum are values of its elements (0 and 1 in this case) That the numeric field stored in the database can have other values is true, but they're not valid values of that enum. It's technically possible to set invalid value, but you can't expect the system to work with such corrupted data.

  • edgcibu Profile Picture
    15 on at

    I agree, therefore the question was what is the possible reason of getting such corrupted data.

    I will search for the field assignment, maybe something is wrong there.

  • Martin Dráb Profile Picture
    239,242 Most Valuable Professional on at

    I've seen a case where developers were intentionally setting an enum value to 255 to get something like a null value (neither Yes or No; an unselected value). But it's not good design.

  • edgcibu Profile Picture
    15 on at

    I found the wrong assignment when importing the enum value from .csv file, from the wrong column. str2enum function is used and when tries to convert unrelated string, I got blank in AX. I think will do some check here, either it is 1 or put 0 otherwise.

    thanks for your time

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 653

#2
André Arnaud de Calavon Profile Picture

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

#3
CP04-islander Profile Picture

CP04-islander 298

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans