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)

FormComboBox sort method

(0) ShareShare
ReportReport
Posted on by 275

I have a combobox that lists all the values of a base enum. I was hoping to sort my values in alphabetical order but the FormComboBox.sort() method does not seem to do anything in my case. From what I've seen it takes either 0 or 1 as an argument for sort order and then should sort the contents of the combobox but that just doesn't happen. My only guess is that maybe it can't sort the values from an enum, but I don't know. Does anyone have any insight on this?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    It is not possible to sort the comboBox value.

    Actually sorting is static and you can do it at design time by assigning enum element value.

    Go to base enum and set the enum value of each element as per you want to see the value.

    as enum value use to numeric then values in combo box will show values in ascending order of enum value.

    Please review following link for more details

    technet.microsoft.com/.../aa881702(v=ax.50)

    Please verify and update if this information helps you.

  • Community Member Profile Picture
    on at

    Yes your guess is right.You cant sort combobox with enum values.

    You can sort combobox by  folllowing 2 methods :-

    1.creating a look up by code & then sort.

    2.Fill the value in combobox dynamically i.e X++ code & then try to sort it.

    Hope it will help you.

    Cheers...

  • Community Member Profile Picture
    on at

    Hi Nitesh

    I think their is some gap.I have an Enum X which have 3 elements in Order i.e A,B,C with enum values 0,1,2 respectively.But on Form i want to see them like this B,C,A  so I changed enum values to A=4,C=3,B=2 . But still its not sorting i can see A,B,C accordingly in my form"s Combobox.

    Can you tell me the exact reason??

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
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans