Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Modify dynamically the FormComboBoxControl element's label

(0) ShareShare
ReportReport
Posted on by 60

Hi guys,

I'm trying to modify one of the element's label from the FormComboBoxControl dynamically.

Let's say the form combo box uses the base enum reqPOType which has the following elements: Purch, Production, Transfer, Kanban. Dynamically, duing the form initialization, I want to change the Kanban label to say something else if it meets certain criteria.

Anyone knows if that's possible?

Regards,

Brightlin

  • Brightlin Profile Picture
    Brightlin 60 on at
    RE: Modify dynamically the FormComboBoxControl element's label

    Yes I've tried that, but since it's bound it didn't work. Thanks Anton!

  • Anton Venter Profile Picture
    Anton Venter 19,493 Super User 2025 Season 1 on at
    RE: Modify dynamically the FormComboBoxControl element's label

    It is however possible to change the text values of the elements of an unbound control using the Text method, see my post above about it.

  • Brightlin Profile Picture
    Brightlin 60 on at
    RE: Modify dynamically the FormComboBoxControl element's label

    Ok. Thanks Girish!

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Modify dynamically the FormComboBoxControl element's label

    From my understanding, I think it's not possible to change the label of the Enum elements at run time.

    As a workaround, you can create your own Enum elements instead of changing the labels and delete the unwanted Enum elements at runtime.

    Refer to the below blog for deleting the Enum elements at run time.

    https://msdax.wordpress.com/2009/04/17/how-to-delete-the-enum-value-at-run-time/

    Thanks,

    Girish S.

  • Brightlin Profile Picture
    Brightlin 60 on at
    RE: Modify dynamically the FormComboBoxControl element's label

    Hi,

    It's a bound control.

    I've seen those links are they weren't helpfull.

    To give you more info.

    If you go to Master planning -> Setup -> Item coverage -> then click on the "Item coverage" button -> under the "General" tab -> the field "Planned order type" is a FormComboBoxControl and I want to change it's element "Kanban" to say something else at runtime.

    I hope it's more clear.

    Regards,

    Brightlin

  • Brightlin Profile Picture
    Brightlin 60 on at
    RE: Modify dynamically the FormComboBoxControl element's label

    Hi Girish,

    I'm not trying to change the label of the FormComboBoxControl's label but rather the label of one of it's element.

    Regards,

    Brightlin

  • Brightlin Profile Picture
    Brightlin 60 on at
    RE: Modify dynamically the FormComboBoxControl element's label

    .

  • Suggested answer
    Anton Venter Profile Picture
    Anton Venter 19,493 Super User 2025 Season 1 on at
    RE: Modify dynamically the FormComboBoxControl element's label

    Hi,

    Have a look at the FormComboBoxControl methods. You should be able to change the Text value of the items in the combobox control at runtime.

    FormComboBoxControl

    https://learn.microsoft.com/en-us/dotnet/api/dynamics.ax.application.formcomboboxcontrol

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Modify dynamically the FormComboBoxControl element's label

    Hi Brightlin,

    Try using label method of the control. Set the Auto declaration property of the control to Yes and then set the label for the control at runtime using label method.

    Refer to the below Microsoft documentation.

    https://learn.microsoft.com/en-us/dotnet/api/dynamics.ax.application.formcomboboxcontrol.label#dynamics-ax-application-formcomboboxcontrol-label

    Thanks,

    Girish S.

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Modify dynamically the FormComboBoxControl element's label

    Hi, You can check if this article helps you. Is it a bound or unbound control?

    thinkinginax.blogspot.com/.../changing-labels-values-using-x.html

    Check this thread

    community.dynamics.com/.../336984

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans