Change table properties using X++ code

If you have ever wondered if you can change table’s properties using X++, here is the answer:
static void ChangeTableProperties(Args _args)
    xInfo xInfo = new xInfo();
    treeNode node = xInfo.rootNode().AOTfindChild("Data Dictionary");
    treeNode childNode;
    treenodeIterator nodeIterator;
    str properties;
    str tables;
    str newLable = "Change label";

    node = node.AOTfindChild("Tables");
    nodeIterator = node.AOTiterator();
    childNode =;
    while (childNode)
      tables = childNode.treeNodeName();
      if(tables == "AssetBook")
        properties = setProperty(childNode.AOTgetProperties(), "Label", newLable);
      childNode =;
Although it is not recommended to modify table properties using X++, it will be useful in some specific situation.

This entry was posted in Axapta Development. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s