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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Get CUS layer changed properties of a table

(0) ShareShare
ReportReport
Posted on by

Hi,

I'm trying to save some documentation time by creating a script that generates technical documentation from AX. The idea is to generate a word document which describes all CUS layer changed objects (subtitles for fields, methods, properties, ...).

This works fine with the TreeNode traversal, except for the properties on table/class level.

I only seem to be able to get a list of all properties of the table, yet I am only interested in the not-default / user changed properties  (= the ones that are highlighted in bold in the properties window).

Here's a POC of the traversal job:

static void TstGetProperties(Args _args)
{
    TreeNode    table, tableCUP, tableSubCUP;
    
    TreeNodeIterator    tableIterator;
    TreeNodeTraverser   nodeTraverser;

    str         tableProp, tableCUPprop;
    
    #AOT
    ;

    
    table       = TreeNode::findNode(#TablesPath + "\\" + "CustTable");
    tableCUP    = table.getNodeInLayer(UtilEntryLevel::cus);
    
    nodeTraverser = new TreeNodeTraverser(tableCUP);
    table = nodeTraverser.next();
    
    while (table)
    {
        info(strFmt("%1, %2", nodeTraverser.infologPrefix(), nodeTraverser.currentNode().AOTgetProperties()));
        table = nodeTraverser.next();
    }
}

I would prefer to avoid reading XPO's from source control and 'scraping' those.

Any help would be greatly appreciated,

thanks,

Gabriël

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,399 Most Valuable Professional on at

    If you get all properties when asking for CUS, can't you get properties for lower layers, compare values and ignore those that are identical?

    By the way, please separate tags with comma and don't prefix them with #. You created attached a single tag #Documentation #Layers, while you clearly means two tags Documentation and Layers.

  • Community Member Profile Picture
    on at

    Yes, taking the difference in properties between the layers is wat i was after!

    Thanks, here's the code if anyone is interested:

        TreeNode            table, tableCUP, tableISV;
    
        List                tableISVPropList;
        ListIterator        listIterISV, listIterCUS;
        
        str                 tableCUPprop, tableISVProp;
    
        #AOT
        ;
    
            
        //Table path  -- Change the table string in this line of code
        table           = TreeNode::findNode(#TablesPath + "\\" + "CustTable");
        
        //Layer-specific tablenode
        tableCUP        = table.getNodeInLayer(UtilEntryLevel::cus);
        tableISV        = table.getNodeInLayer(UtilEntryLevel::isv);
    
        //Properties in String for that table
        tableCUPprop    = tableCUP.AOTgetProperties(false, false, false);
        tableISVProp    = tableISV.AOTgetProperties(false, false, false);
        
        //Populate a list (1 property per value)
        tableISVPropList    = strSplit(tableISVProp, "\n");
        listIterISV         = new ListIterator(tableISVPropList);
        
        //Iterate over the list and subtract each ISV value from the CUS properties
        while (listIterISV.more())
        {
            tableCUPprop = strReplace(tableCUPprop, listIterISV.value(), "");
            listIterISV.next();
        }
        
        //Show the remaining CUS properties
        info(strFmt("%1", tableCUPprop));


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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans