简体   繁体   中英

How to take value from combo box table microsoft dynamics ax 2012 x++ while select

I have table like (1st photo) table

What I should do to take this value to while select in x++? (2c photo) value

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.

  • EDT - In this case \\Data Dictionary\\Extended Data Types\\InventLocationId
  • Table - which has a reference table of \\Data Dictionary\\Tables\\InventLocation
  • Primary Key - which has an alternate primary key of \\Data Dictionary\\Tables\\InventLocation\\Indexes\\InventLocationIdx , which I believe in this case determines the return value
  • AutoLookup - and the AutoLookup located at \\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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM