Notifications
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.
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 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2