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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Boolean as an EDT?

(0) ShareShare
ReportReport
Posted on by 3,850

Hi.

Often I create boolean primitive data type if I wan't to determine something in the class or method - then I often declara boolean  ret;

When I use external software who get or set booleans I find it more practical to create EDT as a boolean so the variable can follow the naming conventions and so on. 

In the followed link it is descriped "Extended data types (EDTs) are user-defined types, based on the primitive data types boolean, integer, real, string, and date, and the composite type container. You can also base EDTs on other EDTs." http://msdn.microsoft.com/en-us/library/aa884607.aspx

But when I want to create EDT in the AOT I can't find the option Boolean.

I think it's also logical that you can't create EDT as a boolean because you can't modify the type - it's always true or false, but sometime I want to follow naming conventions so creating boolean as an EDT is a huge benefit for me sometime.

Is it possible to create boolean as EDT, and if so - how? Is it part og Enum?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    DG Profile Picture
    1,226 on at
    RE: Boolean as an EDT?

    You need to base your EDT on an enumerator. Make sure that the enumerator has only two elements with integer values 0 and 1. This will make sure that conversion to Boolean is easy. One such example in AX is 'NoYesId' EDT which is based on 'NoYes' enumerator. You can use this as a Boolean EDT. Alternatively extend NoYesId EDT.

    Of course, you cannot change its values (true/false or yes/no), but you can change its labels, help texts, default appearance (drop-down / radio button) etc.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Boolean as an EDT?

    For this type of requirement we use NoYesId EDT

    This EDT of type Enum which extends to NoYes Base Enum

    BaseEnum 'NoYes' has two value 'No' and 'Yes' which is equivalent to false and true value of a Boolean variable

    Please verify and let us know if this information is helpful to you.

  • Verified answer
    Rob Hensley Profile Picture
    on at
    RE: Boolean as an EDT?

    Create your EDT as an Enum and make it extend NoYesId.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans