Dynamics AX Blog - aot - Posts from 2014

These posts are machine-translated.
Currently, only posts are displayed, which contain the tag »aot« Filter entfernen
Currently, only posts from »2014« are displayed

Get all tables, where a particular property has a specific value

The following job lists all tables where a particular property - in the example the property ModifiedBy is requested - has a specific value.

In macro #Properties you find another possible properties of AOT objects, so you can use the job also to query other properties.

static void findTablesWithSpecificProperty(Args _args)
{
    TreeNode treeNodeTables;
    TreeNode treeNode;
    str prop;
    str properties;

    #aot
    #Properties;

    treeNodeTables = TreeNode::findNode(#TablesPath + #AOTRootPath);
    treeNodeTables = treeNodeTables.AOTfirstChild();

    while(treeNodeTables)
    {
        properties      = treeNodeTables.AOTgetProperties();
        prop = Global::findProperty(properties,#PropertyModifiedBy);

        if(prop == "yes")
        {
            info(treeNodeTables.AOTname());
        }

        treeNodeTables = treeNodeTables.AOTnextSibling();
    }
}

 
 
 

Add object nodes to a shared project through code

Find below a short example, how to add object nodes to a shared project through code.

static void AddNodeToSharedProject(Args _args)
{
    projectNode projectNode;
    TreeNode treeNode;
    #AOT
    #AOTExport

    projectNode    = infolog.projectRootNode();
    projectNode    = projectNode.AOTfindChild(#expProjectShared);
    projectNode    = projectNode.AOTfindChild('MyProject');
   
    // Add objects
    treenode = TreeNode::findNode(#TablesPath+'\\'+tableid2name(tablenum(CustGroup)));
    projectNode.addNode(treenode);

    treenode = TreeNode::findNode(#TablesPath+'\\'+tableid2name(tablenum(VendGroup)));
    projectNode.addNode(treenode);
   
    treenode = TreeNode::findNode(#ClassesPath+'\\'+classStr(PriceDisc));
    projectNode.addNode(treenode);
}

The so modified Project will look like this:

Screenshot


 
 
 

 

 
 
 
Posts of the actual month
April 2014
MoTuWeThFrSaSu
 123456
78910111213
14151617181920
21222324252627
282930 
 
© 2006-2025 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.