Reputation: 13
I have table like (1st photo) table
What I should do to take this value to while select in x++? (2c photo) value
Upvotes: 0
Views: 1630
Reputation: 11564
The short answer is you would need to take the return from the lookup, find the value in the table via the returned value (key), and take the Name
field.
So this would be the data in your case for the first result:
InventLocation::find('11').Name
This is what's called a lookup
. When you do a lookup, there are multiple methods that AX will determine what values to display. The one you're looking at is a lookup based upon the Extended Data Type
relation.
\Data Dictionary\Extended Data Types\InventLocationId
\Data Dictionary\Tables\InventLocation
\Data Dictionary\Tables\InventLocation\Indexes\InventLocationIdx
, which I believe in this case determines the return value\Data Dictionary\Tables\InventLocation\Field Groups\AutoLookup
determines which fields are displayed to the user as information.If you want a custom lookup to return the InventLocation.Name
field, you should look at the different methods available to you. This blog post is an excellent start to see different methods: https://kashperuk.blogspot.com/2009/04/lookup-methods-tutorial-custom-list.html
Upvotes: 2