Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Creating a stringeditcontrol Label by code

(0) ShareShare
ReportReport
Posted on by 454

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

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Creating a stringeditcontrol Label by code

    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.

  • Ram Kumar Profile Picture
    454 on at
    RE: Creating a stringeditcontrol Label by code

    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

  • Verified answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Creating a stringeditcontrol Label by code

    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.

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Creating a stringeditcontrol Label by code

    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.

  • Ram Kumar Profile Picture
    454 on at
    RE: Creating a stringeditcontrol Label by code

    Hi Nikolaos,

    I want to create new label and to assign the label for the string edit control

  • Ram Kumar Profile Picture
    454 on at
    RE: Creating a stringeditcontrol Label by code

    Hi Nikolaos,

    I want to create new label and to assign the label for the string edit control

  • nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Creating a stringeditcontrol Label by code

    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.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 565

#2
Martin Dráb Profile Picture

Martin Dráb 536 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 402 Super User 2025 Season 1

Product updates

Dynamics 365 release plans