Find all Menuitems Linked to a Form

For diagnostics purposes it is often useful to search the AOT for all objects matching cetain properties. For example you may want to find all display menutitems that are pointing to a specific form. The below job illustrates how to simply traverse the Display Menuitems node in the AOT to locate all items who’s “ObjectType” is “Form” and object is a specific form name. E.G. “PurchReqTable”.

static void FindMenuItemsForForm(Args _args)
 str find = "PurchReqTable";
 TreeNode root = TreeNode::findNode(#MenuItemsDisplayPath);
 TreeNode current;
 TreeNodeTraverser trav = new TreeNodeTraverser(root,false);
 current =;
 while (current)
 if ((current.AOTgetProperty('ObjectType') == "Form") && (current.AOTgetProperty('Object') == find))
 info(strFmt("Found menuitem %1",current.AOTname()));
 current =;



Adapting this to search other nodes is as simple as changing the original node instantiation to search a different path as well as changing the AOTgetProperty() method to search through the properties relevant to you.

Happy Daxing

Original community post:

3 thoughts on “Find all Menuitems Linked to a Form

  1. Note that you can easily find it in cross-references. And if you don’t have cross-references, right-click the node with menu items in AOT, choose Find…, switch Search to All nodes and filter by the Object property on Properties tab.

    • Hi Martin.

      Thank-you for that. I think I’ll try post a walk through with screenshots of your search option above sometime in the future. For some strange reason I’ve never noticed this amazing functionality before and am very grateful to you for pointing it out. I’ll be using it alot in the future.
      I think part of the value of this blog post is to also just illustrate how one could do a basic AOT search in code, so for the moment I think I’ll leave it up for illustration purposes.

Leave a Reply

Your email address will not be published.