<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="https://www.schweda.net/style_feed.css" ?>
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:atom="http://www.w3.org/2005/Atom"	
	xmlns:dc="http://purl.org/dc/elements/1.1/" > 
<channel>
    <title>schweda.net - Blog</title>
    <link>https://www.schweda.net/</link>
    <description>schweda.net - Blog - Blog-Beitraege</description>
    <language>de-at</language>
    <copyright>Copyright 2006-2026</copyright>
    <generator>schweda.net</generator>
    <managingEditor>heinz.schweda@schweda.net (Heinz Schweda)</managingEditor>
    <webMaster>heinz.schweda@schweda.net (Heinz Schweda)</webMaster>
    <category>Blog</category>
	<atom:link href="https://schweda.net/blog_rss.php?bid=614" rel="self" type="application/rss+xml" />
<item>
<title><![CDATA[Shared Project per Code erstellen, Objekte hinzufügen und dabei Gruppen je Objekttyp erzeugen]]></title>
<description><![CDATA[
<p>Mit Hilfe des hier gezeigten Jobs kann man per Code ein Shared Project erstellen, Objekte hinzuf&uuml;gen und diese dabei in Gruppen je Objekttyp einordnen lassen.
</p>


<pre class="pre_blog_axcode">
static void AddNodeToSharedProject(Args _args)
{
    projectNode projectNode;
    TreeNode treeNode;
    ProjectName projectName = &quot;MyProject&quot;;
    
    #AOT
    #AOTExport
    
    void addTreeNodeToProjectNode(treeNode _treeNode)
    {
        TmpIdRef tmpIdRef;
            
        tmpIdRef.clear();
        tmpIdRef.Name = SysTreeNode::getPath(_treeNode);
        tmpIdRef.Mode = SysTreeNode::path2ApplObjectType(tmpIdRef.Name);
        tmpIdRef.useMode = UtilFileType::Application;
        tmpIdRef.insert();
        
        SysProjectFilterRunBase::addProjectNodes(tmpIdRef, projectNode);           
    }

    projectNode    = infolog.projectRootNode();
    projectNode    = projectNode.AOTfindChild(#expProjectShared);
    projectNode    = projectNode.AOTfindChild(projectName);
   
    // Create shared project if neccessary
    if( !projectNode)
    {
        projectNode = SysTreeNode::createProject(projectName, ProjectSharedPrivate::ProjShared);        
    }
    
    // Add objects (and create groups)
    treenode = TreeNode::findNode(#TablesPath+#AOTRootPath+tableid2name(tablenum(AccountingDistribution)));
    addTreeNodeToProjectNode(treenode);

    treenode = TreeNode::findNode(#TablesPath+#AOTRootPath+tableid2name(tablenum(VendGroup)));
    addTreeNodeToProjectNode(treenode);
   
    treenode = TreeNode::findNode(#ClassesPath+#AOTRootPath+classStr(PriceDisc));
    addTreeNodeToProjectNode(treenode);

}
</pre>


<p>Auf die gleiche Art &amp; Weise kann man nat&uuml;rlich auch ein Private Project erstellen, einfach die Vorkommnisse von <em>Shared </em>durch <em>Private </em>ersetzen.
</p>


<p>Das erstellte Projekt sieht wie folgt aus:
</p>


<p><img alt="Sceenshot" height="226" src="http://www.schweda.net/pictures/blogpics/ax2012_myprojectwithgroups.jpg" title="Screenshot" width="327" />
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sun, 26 Feb 2017 18:53:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=614</link>
<comments>https://www.schweda.net/blog_ax.php?bid=614</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=614</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=614</wfw:commentRss>
</item>
<item>
<title>Kommentar von D365</title>
<description><![CDATA[Informative blog. Thanks for sharing.]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sat, 28 Dec 2019 10:04:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=614</link>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=614</guid>
<author>D365</author>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Heinz Schweda</dc:creator>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=614</wfw:commentRss>
</item>
</channel>
</rss>	
