Notifications
Announcements
No record found.
Hi,
I need to create label for a string edit control in a form. I need code for that . I am new to AX
Thanks in advance,
Ram
Do you mean you want to create a new label? Or assign an existing label?
For existing label do this:
1) Set property AutoDeclaration of the control to Yes
2) In Init method of the form, after super(), add MyControl.label("@MyLabel") (assuming your control is called MyControl and your label id is MyLabel.
Hi Nikolaos,
I want to create new label and to assign the label for the string edit control
Go to the properties of the control. In Label field, type the text that you want to have in the label. Then click the button in the right edge of the property field. Label editor opens, automatically searching if there is already a label that matches your text. If not, you can create a new label. Finally, click "Paste label" to bring this label Id in your stringedit control.
Ah, but you asked how to create it in code. What would be the business requirement for that? Could you share it? In general it doesn't seem like a very good idea to me. Usually you have multiple AOS instances in your prod system, and form changes, and new labels are not synced to other AOS instances if you make such changes when the application is running.
Once we hear your business requirement, we can discuss possible solutions to it.
I need to create a new label by code and i have to set for a stringeditcontrol. or i want to update the existing label with a new label . Is it possible
That's not a business requirement, that's a description of a technical solution that you think would fit the business requirement.
Could you share the business requirement? What is the process / scenario where you would use this code? I already mentioned in my previous message why it doesn't seem like a good / working idea. Please let us know more so that we can help you as good as possible.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 592 Most Valuable Professional
André Arnaud de Cal... 478 Super User 2025 Season 2
BillurSamdancioglu 305 Most Valuable Professional