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

Announcements

News and Announcements icon
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
    239,678 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dserp Profile Picture

dserp 4

#2
dekion Profile Picture

dekion 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans