AX 2012 TABLE LOOK UP

Hello All,

Here’s the scenario,

I need to be able to create a table, lets call it TABLE A, that allows for one to have a lookup of all other tables I have in my AOT. Now in my TABLE A, I want to have two columns, one that selects the table and a second column, B that selects a table field from the table specified in column A.

After doing this, I expect to have a TABLE B that will now just be looking up column B (the one with the fields) from table A

Is this doable and if yes, could one of you kindly guide me on how to go about it soonest possible.

May be share an XPO even :slight_smile:

Thanks.

ShinjaKE

You can access such information through the SysModelElement table, therefore you can use exactly the same techniques as when building lookups for business data.

For example, to get a lookup for table names, you can define a relation to SysModelElement.Name with related field fixed set to ElementType = 44. Or you can override lookup() to show different fields.

When looking for fields, filter by ParentModelElement to get only fields related to the given table.

Thanks Martin,

I forgot to add that I am a total newbie to Dynamics AX, only been using it for a little over a month so I’m a little green (using AX 2012 R2). If you could kindly share some XPO or a walk through on the same that would be a bit easier to understand thanks.

How far have you got? Have you created a table? Have you defined the relation? What’s the problem you need help with?

HI Chege Newton

Do as per suggestion of Martin Dráb it works,

As per words form Martin Dráb . I did it working fine …

1). Create Table eg: TableA

2).Add filed : Name

3).create relation on Table A with sysmodelelement

**4) select normal relation like TableA==**sysmodelelement .Name

**5)select related field fix like 44==**sysmodelelement .ElementType

save it

open TableA… All tables appear in look up at Name filed on TableA…

Martin Dráb Thanks for your time …

hello all,

sorry for the late reply. I was a bit ill. But yes, tried this today and it worked well. Thank you Martin Drab. Sorry for all the newbie questions i’m coming from doing Dynamics NAV all along. Thanks Kumar too.

Also, is there now a way to add another field that selects fields from the table selected in the field with the table name. Kindly share

Thanks for the support you have and will give me in future. [:D]

You shouldn’t ask whether it’s possible, because I already answered that in my first reply: “Or you can override lookup() to show different fields”.

You can ask how to implement lookup() method, though. And the first place to look at should be the documentation: How to: Add a Run-Time Lookup Form [AX 2012].

Dear Martin,

How we will do in the Ax 2009?

thanks in advance,

Murali

@Murali: Use UtilElements table in AX 2009, otherwise it’s very similar.