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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Finding Values from a form control Outside Forms

(0) ShareShare
ReportReport
Posted on by 275

Hi, i was wondering if it is possible to get the values from my form controls. Through x++ code from my class or my table method ?

I am iterating through my form, and i want to get all the names and values. I got the names but not values, please help thanks.

*This post is locked for comments

I have the same question (1)
  • Community Member Profile Picture
    on at

    Hi Ashein,

    the FormStringControl for instance has a method named "valueStr".

    I assume you you got access to the FomControl-Object?

    Regards

  • Ashein Profile Picture
    275 on at

    I have used ValueStr, Text but it all comes up empty

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    definitely you can get value of controls, if you are able to get controls name

    But the challenging factor can be control types, as value can differ with control Types.

    Getting control names is easy because its just ContolName.Id()

    you can get values of majority of controls as under

    info("Value of control: "+any2str(element.control(formBuildControl.id()).valueStr()));

    further if you want to make it more sophisticated, you have identify control types an then write a switch statement to convert control value to display it appropriately

  • Community Member Profile Picture
    on at

    Ah maybe it's the "text()" method? But the MSDN points on valueStr().

    I try to find an example...i'm sure i used this somewhere

    Edit:

    "valueStr()" works fine for me...you may check Sohaib Cheema hint too

  • Ashein Profile Picture
    275 on at

    But is'nt this method only used in the form ? I am looking to get the value through my class.

  • Community Member Profile Picture
    on at

    Ok so you don't have access to the form control object in your class?

  • Ashein Profile Picture
    275 on at

    I have access to all my form object control, i just can't get the value even though i identified my object by using Fx. (_formControl is FormStringControl).

  • Community Member Profile Picture
    on at

    hmm sounds strange.

    I tried this myself and it works for me. Do you pass the object on ""mouseUp"?

  • Ashein Profile Picture
    275 on at

    I don't understand, pass "mouseUp" ? i am not in the form. I have created a class A, and through the class i am trying to get the values from my Form B.

  • Community Member Profile Picture
    on at

    I try to understand whats the state of your object the time you pass it to your class. The form "B" is initialized the time you pass it to your class? Maybe the object is not initialized at the time you pass it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans