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
Yes I've tried that, but since it's bound it didn't work. Thanks Anton!
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.
Ok. Thanks Girish!
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.
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
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
.
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
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.
Thanks,
Girish S.
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
André Arnaud de Cal...
291,969
Super User 2025 Season 1
Martin Dráb
230,842
Most Valuable Professional
nmaenpaa
101,156