Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

ax 2012 - Prevent wrong enum value in a form

(0) ShareShare
ReportReport
Posted on by 1,087

Hi, i have a combobox in a form with three values, say "one","two","three".

I do a check on inventtable to find if the value i'm setting is ok for that item.

How do i take back the combobox to the original value once the user has selected the wrong one?

I dont know where is the right point to put the code.

Thank you in advance

regards

*This post is locked for comments

  • Suggested answer
    Ryuji Mita Profile Picture
    465 on at
    RE: ax 2012 - Prevent wrong enum value in a form

    If you're doing validation on a persisted field, you should be doing it inside the validateField(validateFieldValue in AX2012) method on the table, which is a method called by the AX framework.

    If so, returning false for failed validation is all you need to do, and the AX framework will change the value back to the original value.

    In your case, if the enum is a field on inventTable, modify the inventTable.validatefield method, should be the only thing you need to do.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,101 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans