how to get list oftables ( table Group(main) )tables in X++
in Ax we have more than 9 thousand tables, how to identify parameters table or main table using code in X++
how to get list oftables ( table Group(main) )tables in X++
in Ax we have more than 9 thousand tables, how to identify parameters table or main table using code in X++
``
static void AOT_TableGroup(Args _args)
{
TreeNode tableNode = TreeNode::findNode(@’\Data Dictionary\Tables’);
TreeNodeIterator iterator = tableNode.AOTiterator();
ClassName tableName;
UtilElements utilElements;
;
tableNode = iterator.next();
while(tableNode)
{
i++;
tableName = tableNode.treeNodeName();
tableNode.AOTgetProperties(true);
select utilElements
where utilElements.RecordType == UtilElementType::Table
&& utilElements.Name == tableName;
info(strfmt(’%1 - %2’,tableName, tableNode.AOTgetProperty(‘TableGroup’)));
tableNode = iterator.next();
}
}
static void groupTablesNames(Args _args)
{
int i;
Dictionary dict = new Dictionary();
DictTable dictTable;
for (i=1; i<=dict.tableCnt(); i++)
{
dictTable = new DictTable(dict.tableCnt2Id(i));
if (dictTable.tableGroup() == TableGroup::Group) // change it to what ever table group you want
{
info(dictTable.name());
}
}
}
If you’re interested only in standard tables, you don’t have to write any code. Simply download the list provided by Microsoft and filter it by Table group.