This post is machine-translated. The original post in german language can be found here.

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

These post applies to following versions:
Dynamics AX 2012, Dynamics AX 2009, Dynamics AX 4.0, Axapta 3.0, Axapta 2.5

Add comment
 
 

 

 
 
 
Posts of the actual month
April 2024
MoTuWeThFrSaSu
1234567
891011121314
15161718192021
22232425262728
2930 
 
© 2006-2024 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.