Personalized Community is here!
Quickly find the content you seek
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 release wave 1Discover the latest updates and new features to Dynamics 365 planned through September 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 TimelineWatch the 2020 Release Wave 1 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
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?
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.
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
Are you getting the value through code?
Maybe this will help：
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.
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.
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.
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
Business Applications communities