List of menu objects

If you run the below code, you will get a list of every table in AX. Is there code that could allow you to get the same for menu items? I’ve looked through various Dict classes and not been able to find anything. I’m planning on having a selectable list of menu items that I’ll work with, similar to what pops up for tables when the global method pickTable() is called.

Dictionary dict = new Dictionary();
DictTable dictTable;
int i;
;

for (i=1; i<=dict.tableCnt(); i++)
{
dictTable = new DictTable(dict.tableCnt2Id(i));
info(dictTable.name());
}

Try to use TreeNode and TreeNodeTraverse…

Here is ready solution

static void searchSubNodes(Args _args)
{
str treeNodeNames;

void searchSubNodes (TreeNode _treeNode)
{
if (!_treeNode)
return;

_treeNode = _treeNode.AOTfirstChild();
while (_treeNode)
{
if (_treeNode.AOTfirstChild())
{
searchSubNodes(_treeNode);
}

if (_treeNode.applObjectType())
{
treeNodeNames += strfmt("%1\n", _treeNode.treeNodeName());
}

_treeNode = _treeNode.AOTnextSibling();
}
}
;

searchSubNodes (TreeNode::findNode(@"\Menu Items"));

info(treeNodeNames);
}

That was exactly what I was looking for, thanks so much. ^^