Wednesday, March 6, 2013

How to get an AX table name from a Table Id

This is a quick post but I'm sure it might help the newbie AX programmers out there.

If you have the id from a table in AX and you need to find out the name of that table, you can use the tableId2Name functionality.

static void Job17(Args _args)
{
    info (strFmt("%1", tableId2name(865)));
}
Figure 1 - The code to get the table name from an id

Figure 2 - The output from the job in Figure 1

static void Job17(Args _args)
{
    info (strFmt("%1", tableName2id('CustTransOpen')));
}
Figure 3 - The code to get the table id from a table name


Figure 4 - The output from the job in Figure 3

5 comments: