Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to get value of a field present in form ?

Posted on by Microsoft Employee

I want to use  value  in a field of a form in X++ code. How can i achieve that?  

For ex : 1004.Capture.PNG

Here i want to use value of main account's value in code ( in modified method). 

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get value of a field present in form ?

    Thanks for helping

  • Verified answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: How to get value of a field present in form ?

    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.

  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to get value of a field present in form ?

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get value of a field present in form ?

    should i use StringEdit.text()

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans