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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Hiding enumvalues in bounded combobox on a form

(0) ShareShare
ReportReport
Posted on by

I do have a combox on a form bounded to an enum with 6 values in. Now I want to hide element 3,4 and 5.

The only solution I found for bounded combobox was to delete the element, but than the selection is messed up because if you select the 6 element of the enum you get the wrong value (value 3)

How can I fix this?

*This post is locked for comments

I have the same question (0)
  • Ivan (Vanya) Kashperuk Profile Picture
    on at

    Not sure if what you mean by "bound" is what AX devs normally mean as "bound", so just gonna throw this link in there, in case my guess was acurate.

    kashperuk.blogspot.com/.../sysformenumcombobox-class-allowing-to.html

  • Community Member Profile Picture
    on at

    this does not work. I tried that as well. in the post it says:

    P.S. It is also worth mentioning, that this class does not provide support for grids. It requires a stand-alone control, not bound to a database table field.

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    hi,

    use the selectionChange() handler and override it.

  • Community Member Profile Picture
    on at

    you mean do like I did (delete the elements) and in selectChange() get the correct elementnum and set this?

  • Verified answer
    keoma Profile Picture
    32,729 on at

    define an additional enum field with all 6 values. delete the not used values from the original enum field.

    with the combobox.selectionchange handler set the needed value 6 to the 2. enum field, if in the combobox is the 3. value selected.

    so in the 2. enum field you have the correct value to use for further processing.  

  • Suggested answer
    Deepak Agarwal Profile Picture
    8,602 on at
  • Ajay Kumar Y Profile Picture
    218 on at

    Hi Chris,

    Did you get the solution for this, even my requirement is also exactly yours.

    Can you please post the solution here.

  • Ajay Kumar Y Profile Picture
    218 on at

    Hi Deepak,

    I tried the solution what you had provided, but it won't work, if it's in a grid, as it is not showing the proper elements in the combo box after the deletion (by overriding the enter method on the control).

    Can you try your solution in a grid (enum is bounded control in my scenario) and let me know with the solution.

  • Suggested answer
    ImperialS Profile Picture
    425 on at

    Good evening.

    In order to resolve this issue with a grid control - override a form's run method and use a combobox's delete method to remove an extra element.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans