Announcements
No record found.
I want to use value in a field of a form in X++ code. How can i achieve that?
For ex :
Here i want to use value of main account's value in code ( in modified method).
*This post is locked for comments
should i use StringEdit.text()
Hi Sagar U,
You should avoid refereing to controls directly. Usually controls have datasource field linked to them and you should use this field in your code, if control is unbound there should be a display method behind and you can use it to retrieve a value.
Right click > Personalize > the bottom right corner should tell you what form datasource, table, field and/or display method is being used on that control.
Ideally you would want to refer the table buffer and the field if it is a bound countrol like Ievgen has mentioend, or the display method (which could be implemented either on the form datasource, or on the table behind).
If it is an unbound control, you need AutoDeclaration = Yes set for the control, then you could use the value as you have mentioned directly from the form control.
Thanks for helping
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CP04-islander 39
Michel ROY 14
imran ul haq 8