How to get many values from lookup form axapta?

Hi All,

I've created a SysTableLookupForm with several lookup fields.
Is it possible to get the values of all lookup fields in the selected line after performFormLookup()?
As far as I know, SysTableLookup.performFormLookup() gives back only the values of the first lookup field.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It's been a few months since my last AX project, and I don't have AX available right now so I can't verify my suggestion, but couldn't you simply put the single return value into a variable, then use that variable as an argument in a query to return the entire table?

Suppose you do a lookup on InventTable, it would be something like:

ItemId itemId;
InventTable inventTable;
itemId = //put code here to perform lookup
select inventTable where inventTable.ItemId = itemId;
//do something with inventTable

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wurthphoenixAuthor Commented:

yes, you're right.  This is the solution, which I used to solve my problem.
With specifying the second parameter of SysTableLookup.addLookupField(fieldId, returnItem) I was able to get the value of any field, not just the firstly added lookup field.
Although your suggestion is not the exact answer to my question but I think, there's no chance to get _all_ lookupfield-value, therefore I accept your soluton.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Dynamics

From novice to tech pro — start learning today.