General X++ Development

How do I get a table name from a TableId in X++?

Asked by Sunny Vasty· Aug 13, 2026· 1 answers

How do I get a table name from a TableId in X++?

SSunny Vasty75 reputation · answered Aug 13, 2026

Use tableId2Name().

X++
str tableName = tableId2Name(tableNum(CustTable));

info(tableName);

For metadata-heavy or generic code, helper functions like this are much better than hardcoding table names as strings.