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)

How to get field value from FORM?

(0) ShareShare
ReportReport
Posted on by

Hello!

I guess I have a fairly easy question, but I still require assistance...

I have to fill field with values, depending on current data in form, and for that I am writing display method, with select statement, that will fetch the data  I need, but how do I get those values in that FORMS fields.

For better understanding, lets say I have from FORM and fields A, B, C, D

I need to fill field D (display method) with values depending on values in field C.

Thanks you for assistance!

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    303,247 Super User 2026 Season 1 on at

    Hi MrRobot,

    For normal fields the properties DataSource and DataField are used.

    To display a displaymethod you can use the properties DataSource and DataMethod. So the method name should be entered in the DataMethod property.

    Make sure the display method is or defined on the table itself or a new method on the datasource.

  • Community Member Profile Picture
    on at

    Yes, I know about that - but how can I get the FIELD C value? 

    So, If I add the method to properties and write

    Table table;

    DataSourcetable dsTable; 

    select FIELD from table

    where  table.FIELD1 == dsTable.D; (will this be the fields D value in form ?)

  • Verified answer
    Martin Dráb Profile Picture
    238,745 Most Valuable Professional on at

    Your example isn't clear to me, so let's assume that you have a table called Table1 with a field called FieldC.

    Then write a display method on the table and refer to FieldC as this.FieldC. Do your magic and return some value from the method (which represents D). Bind a form control to this method and you're done.

  • Community Member Profile Picture
    on at

    Thank you!

    That did work!

    but still - if I write display method for datasource (not Table), how can I refer to fields current value?

  • Suggested answer
    Martin Dráb Profile Picture
    238,745 Most Valuable Professional on at

    If you write a display method on a form, you have to pass the current record as a parameter. For example, you get _table1 buffer and refer to the field as _table1.FieldC.

    Note that you typically want display methods on tables, so you can use them in several forms and cache their values (which is important especially if you communicate with database inside the method).

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
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#1
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#1
Pratik Bhosle Profile Picture

Pratik Bhosle 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans