How Can we get a lookup of all TableNames ?

How can we select a table dynamically in an select statement?

For example



Try This

static void TableNames(Args _args)
tableId tableId;
int tablecounter;
Dictionary dict = new Dictionary();
for (tablecounter=1; tablecounter<=dict.tableCnt(); tablecounter++)
tableId =dict.tableCnt2Id(tablecounter);
info(dict.tableName(tableId)); }

hope It will help U :slight_smile:

Just be careful that this returns also views, maps, temporary tables and tables disabled by configuration keys, which is usually not what people want.

To skip such objects, use DictTable.isMap(), DictTable.isTmp() etc. If you are in AX2012, SysDictionaryFiltered::applicationTables() may be the easiest solution.

Depending on exact requirements, UtilElements and SqlDictionary tables might be used instead of Dict* classes.

Thanks Martin for your inputs.

It will be helpful for us…