web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to display the list of all AOT forms

(0) ShareShare
ReportReport
Posted on by 1,737

I want to display list of all forms form AOT Through job.

Suppose i am write a code in job and run this job, i want to print all forms one by one in info log

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    There can be many ways. one way is that, you can get list of all forms, from UtilElements view. and you can filter this by UtilElementType

  • srinivas pamidi Profile Picture
    1,737 on at

    Can you Just tell me the Code for this.

    i am trying to write the below code, but i didn't get the macro for forms.

    static void daxFormAnalyzer(Args _args)

    {

       #AOT

       #Properties

       TreeNodeIterator          templateNodes;

       TreeNode                      templateNode;

       SysDictType     template;

       templateNodes = TreeNode::findNode(#UtilElementType).

       templateNode = templateNodes.next();

       while (templateNode)

       {

           info(strFmt("%1 - %2", SysLabel::labelId2String2(findProperty(templateNode.AOTgetProperties(), #PropertyLabel), 'en-us'),

                                  SysLabel::labelId2String2(findProperty(templateNode.AOTgetProperties(), #PropertyHelpText), 'en-us')));

           templateNode = templateNodes.next();

       }

    }

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    you can get these as under

    static void ListOfForms(Args _args)
    {
        UtilElements        localEelmet;
        UtilEntryLevel      LayerName = UtilEntryLevel::usr;
        TreeNode            treeNode;
        
        ;
        while select localEelmet
            where localEelmet.recordType == UtilElementType::Form
                && localEelmet.utilLevel == LayerName  //remove this line if you want all layers
        {
    
            treeNode = xUtilElements::getNodeInTree(xUtilElements::parentElement(localEelmet));
    
            info(strFmt("Name: %1",localEelmet.name));
    
    
        }
    
    }

    Make sure

    1) remove 2nd part of where clause, which is restricting the objects to a specific layer, if you want to get all form names from all layers.

    2) you can also add a progressbar, otherwise job can take long time

  • srinivas pamidi Profile Picture
    1,737 on at

    thank you It is working fine..

    i want to display the path name of the every form,,

    Example

    take custtable listpage form it is used in the AccountsRecievable ->common->customers->All Customers.

    for Every form i want to display like this, where it is used.

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    a form can be located at more than one locations in Rich Client.

    e.g. same form custtable, might be located in AccountsRecievable as well the same form might be located in sales & Marketing also.

    The list might keep increasing on and on, as you keep on adding a form menu item to a new location in user interface

    if you have SDT installed you can see how it builds tree based on selection of role.

    can you  share your business scenario what you want to do, at end of day from business perspective.

  • srinivas pamidi Profile Picture
    1,737 on at

    My client wants know where the form is used with navigation.

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    this is an interesting requirement.

    unfortunately I don't have x++ code ready for this to share with you. you can create a new thread or you can wait on this thread for contribution of other contributors.

    I am not making any promise but I would try to find time to write code or blog post for this, later by this weekend. this is doable as you can traverse tree nodes

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    This structure which you mention as an example is going from the AX modules as a starting point. For that what you can do is start iterating through the Menus AOT node. You could start building your string to info out based on the menu/sub-menu structure. For each of them that are not sub-menus, they have a menu item behind that could be referring to a form, class or report (respectively display, action and output menu item types). You could then just get the label of the menu item and append it to the end of the string. This will give you the desired results.

    Also do not forget like Sohaib said, AX forms can be opened from a multitude of sources that are not necessarily accessible straight from the menus!

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    I have done my working already for this 2nd requirement. I will be blogging a post tonight for this, which will provide the required information on 3, 4 clicks.

  • Suggested answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Hi srinivas pamidi,

    you many have a look at blog  post

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans