Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

List of All Table with ID, Name and Label

Posted on by Microsoft Employee

Can anyone help me to retrieve the list of all tables in ax 2009 with ID, Name and Label

  • Martin Dráb Profile Picture
    Martin Dráb 228,112 Most Valuable Professional on at
    RE: List of All Table with ID, Name and Label

    You already have X++ code doing that.

    Use Business Connector to call X++ code AX 2009 from C#.

  • karthickarden Profile Picture
    karthickarden 135 on at
    RE: List of All Table with ID, Name and Label

    Hi,

    I want to get the custom tables list from Dynamics AX 2009 through C#.

    Could you please provide the sample code

    Thanks

  • Suggested answer
    Rudi Hansen Profile Picture
    Rudi Hansen 3,985 on at
    RE: List of All Table with ID, Name and Label

    This job should do the trick.

    static void TableList(Args _args)
    {
        tableId         tableId;
        int             tablecounter;
        Dictionary      dict = new Dictionary();
     
        for (tablecounter=1; tablecounter<=dict.tableCnt(); tablecounter++)
        {
            tableId = dict.tableCnt2Id(tablecounter);
            info(strFmt("TableId: %1 ; Name: %2 ; Lable: %3",tableId,tableid2name(tableId),tableid2pname(tableId)));
        }
    }
  • Suggested answer
    sohaibcheema Profile Picture
    sohaibcheema 46,594 User Group Leader on at
    RE: List of All Table with ID, Name and Label

    yeah you can get list as following

    static void ListOfTables(Args _args)
    {
        UtilElements        localEelmet;
        UtilEntryLevel      LayerName = UtilEntryLevel::usr;
        TreeNode            treeNode;
        
        ;
        while select localEelmet
            where localEelmet.utilLevel == LayerName
                && localEelmet.recordType == UtilElementType::Table
        {
    
            treeNode = xUtilElements::getNodeInTree(xUtilElements::parentElement(localEelmet));
    
            info(strFmt("TableId: %1 ; Name: %2",localEelmet.TableId,localEelmet.name));
    
    
        }
    
    }

    • But remember, running job can take long time, so better to use progress bar and save this information somewhere in new table or on any report.
    • Also don't forget to change/remove Layer range in query, as per your own need

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,263 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,112 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans