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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to set the value of a field on the basis of the selected value of lookup on another field

(0) ShareShare
ReportReport
Posted on by 55

Hi All,

I am new to dynamics ax. Can anyone help me on below issue.

I have a form containing a grid. On one of the column(lets say itemId) of grid I have applied a lookup(which contains an itemId and its description). I want that on selecting a record in lookup the corresponding description is automatically populated in another column in the grid.

I have an idea that I have to override the modified() method for field itemId in the datasource.

Please advice me how to get the selected value of lookup and set it in another field.

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Jo Neetesonne Profile Picture
    175 on at
    Depending on what datasource you are talking about:

    Check the table (for example SalesLine) and see if you have a method there called "initFromInventTable".

    Even better (if you are actually using SalesLine) check class SalesLineType for the same method and fill the field there.
  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    If you're in AX 2012, you may actually want to use a foreign key and a replacement group instead of creating another field.

    Also consider a display method - it can cause performance problems, but you won't be responsible for maintaining data integrity.

    Finally, to your question about copying to a column - if you can, override modifiedField() method on the table and handle it there. If your field is called Field1, you'll get its value as this.Field1. If you have to do it at the data source level, override modified() method on the field and access the value through data source name, e.g. myDataSource.Field1.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans