Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

BaseEnum in Form

Posted on by Microsoft Employee

Hi Community,

I have an BaseEnum "VehicleTyp" with the Elements "Car" (1) and "Truck" (2).

I have a Form "Rentals"

In that Form the EnumValue is not choosen, since I started the values with 1 and 2.

But I'd like to have a text in there, which say's "Choose" but without making a new Element.

I tried to override the initValue() in my rentalTable by saying "this.vehicleTyp = "Choose" ;  but that doesn't make sense at all... just wanted to Show that I am thinking on how I can get it fixed.

Any recommendations ?

Thanks in advance

ForCommunity7.PNG.jpg

*This post is locked for comments

  • Suggested answer
    startax Profile Picture
    startax 1,845 on at
    RE: BaseEnum in Form

    Hi Khasayar,

    As @Crispin suggested create enum with "Choose" label. And write code in table validatewrite() method

  • Suggested answer
    Mahmoud Hakim Profile Picture
    Mahmoud Hakim 17,887 on at
    RE: BaseEnum in Form

    try to pass init value in form level

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: BaseEnum in Form

    That's most likely the fastest alternativ.

    But I am afraid, that if then the end user selects choose (basically this Element 0 ) then it will be a data entry in the table.

    But maybe I can then make changes in the Code, which basically doesn't allow an Element 0 entry in the table ?!

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans