web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Getting values from a form field

(0) ShareShare
ReportReport
Posted on by

I'm sure this is a simple question, but I only get into X++ every once in awhile. I want to write a simple method to calculate the check digit on a bar code while the user is entering it.  I would like to have the method perform the calculation after each keystroke in the specific field.  So while the user is entering the bar code in the InventItemBarcode.ItemBarCode field, the system will calculate the appropriate check digit and show a message in a custom field on the InventItemBarcode form.

So here is what I don't know.   How do I get the value out of the form field.  I've been experimenting with overwriting the "textChange" and/or "modified" methods on the InventItemBarcode/Designs/DesignList/InventItemBarcode_itemBarCode.

But I don't know how to capture the data that is entered into the field.  I can get the method to run every time the field is clicked/changed, but I don't know the code to access the data entered.  "myVariable = this.text()" doesn't work.  Any thoughts on how I can get a variable to pick up the field value of a field on a form after each keystroke?  Detailed code would be super helpful.  I've spent a fair bit of time Googling how to pull the data in a form field to a variable.  I'm sure it is simple, but I haven't found it yet.  Any ideas would be appreciated.  Thanks!

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    297,611 Super User 2025 Season 2 on at
    RE: Getting values from a form field

    Hi,

    Try this statment: "myVariable = this.valueStr()"

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans