<?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 - Dynamics AX 4.0</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://www.schweda.net/blog_rss.php?vtid=ax40" rel="self" type="application/rss+xml" />
<item>
<title><![CDATA[Namen der Shared Projects nach einem String durchsuchen]]></title>
<description><![CDATA[
<p>Um sich alle (Shared-)Projekte ausgeben zu lassen, die einen bestimmten Text im Namen tragen, kann man den folgenden Code verwenden.
</p>


<pre class="pre_blog_axcode">
static void searchProjectName(Args _args)
{
    ProjectNode projectNode;

    #AOTExport

    projectNode    = infolog.projectRootNode();
    projectNode    = projectNode.AOTfindChild(#expProjectShared);
    projectNode    = projectNode.AOTfirstChild();

    while(projectNode)
    {
        setPrefix(projectNode.name());

        if(strScan(projectNode.name(), &quot;BR_&quot;, 0, 60))
        {
            info(projectNode.name());
        }

        projectNode    = projectNode.AOTnextSibling();
    }
}
</pre>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sat, 21 May 2016 19:09:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=598</link>
<comments>https://www.schweda.net/blog_ax.php?bid=598</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=598</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=598</wfw:commentRss>
</item>
<item>
<title><![CDATA[Statt Parameter-Listen einen DataContract verwenden]]></title>
<description><![CDATA[
<p>Wer schon einmal die Parameter einer Methode erweitern musste, kennt vielleicht das Problem: Wenn man Gl&uuml;ck hat kann man seinen neuen Parameter am Ende einf&uuml;gen und mit einem Default-Wert vorbelegen.<br />
<br />
Hat man nicht ganz so viel Gl&uuml;ck und muss entweder der Parameter zwischen den vorhandenen einbauen oder darf/kann keinen Default-Wert angeben so muss man den gesamten AOT nach den Aufrufen dieser Methode durchsuchen (die Querverweise helfen hier enorm) und diese entsprechend anpassen.<br />
<br />
Aufgrund dieser Problematik gehe ich bei meinen Methoden nun oft den Weg, da&szlig; ich nur einen einzigen Parameter einf&uuml;ge, und zwar vom Typ einer - nennen wir sie einfach einmal DataContract-Klasse.<br />
<br />
DataContracts sind dem einen oder anderen vielleicht aus dem SSRS-Umfeld bekannt, aber die selbe Logik kann ich auch in vielen anderen Situationen anwenden.<br />
<br />
So sieht eine solche DataContract-Klasse beispielweise wie folgt aus:
</p>


<div class="div_blog_axcode">classDeclaration MyDataContract<br />
{<br />
&nbsp;&nbsp;&nbsp; ItemId itemId;<br />
&nbsp; &nbsp; Qty qty;<br />
}
</div>


<p>&nbsp;
</p>


<div class="div_blog_axcode">Public ItemId parmItemId(ItemId _itemId = itemId)<br />
{<br />
&nbsp;&nbsp;&nbsp; itemId = _itemId;<br />
&nbsp;&nbsp;&nbsp; return itemId;<br />
}
</div>


<p>&nbsp;
</p>


<div class="div_blog_axcode">Public Qty parmQty(Qty _qty = qty)<br />
{<br />
&nbsp;&nbsp;&nbsp; qty = _qty;<br />
&nbsp;&nbsp;&nbsp; return qty;<br />
}
</div>


<p><br />
Eine Methode k&ouml;nnte dann wie folgt aussehen:
</p>


<div class="div_blog_axcode">Public void myMethod(MyDataContract _dataContract)<br />
{<br />
&nbsp;&nbsp;&nbsp; // &hellip; do something&hellip;<br />
&nbsp;&nbsp;&nbsp; info(_dataContract.parmItemId());<br />
}
</div>


<p><br />
Aufrufen muss ich eine solche Methode so:
</p>


<div class="div_blog_axcode">MyDataContract dataContract;<br />
dataContract = new MyDataContract();<br />
dataContract.parmItemId(&quot;A1000&quot;);<br />
dataContract.parmQty(123);<br />
<br />
Object.myMethod(dataContract);
</div>


<p><br />
Kommt nun sp&auml;ter ein neuer Parameter hinzu, muss ich den lediglich entsprechend in der DataContract-Klasse einf&uuml;gen und die Logik in der Methode erweitern. Die Methodenaufrufe k&ouml;nnen u.U. so bleiben wie sie waren, lediglich die Aufrufe wo die ge&auml;nderten Parameter ber&uuml;cksichtigt werden m&uuml;ssen, m&uuml;ssen angepasst werden.<br />
<br />
Und zu guter Letzt kann ich solche DataContract-Klassen nat&uuml;rlich f&uuml;r mehrere Methoden verwenden.<br />
&nbsp;
</p>


<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Tue, 14 Jul 2015 14:57:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=579</link>
<comments>https://www.schweda.net/blog_ax.php?bid=579</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=579</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=579</wfw:commentRss>
</item>
<item>
<title><![CDATA[Eine bestimmte Dimension als Dialogfeld einbinden]]></title>
<description><![CDATA[
<p>Wenn man in Dynamics AX 2009 (oder fr&uuml;heren Versionen) eine bestimmte Dimension als Dialogfeld verwenden m&ouml;chte, kann man sich einen eigenen Extended Datatype (abgeleitet von <em>Criterias</em>) wie im folgenden beschrieben anlegen. Entscheidend sind dabei die Relations dieses EDTs.<br />
<br />
Im Beispiel soll beispielsweise der Kostentr&auml;ger als Dialogfeld angeboten werden.
</p>


<p><img alt="Screenshot EDT" height="93" src="http://www.schweda.net/pictures/blogpics/ax_dimensioncostcenter.jpg" title="Screenshot EDT" width="321" />
</p>


<p>Der Beispiel-Code ist einer von RunBase abgeleitenden Klasse entnommen.
</p>


<pre class="pre_blog_axcode">
protected Object dialog(DialogRunbase dialog, boolean forceOnClient)
{
    Object ret;

    ret = super(dialog, forceOnClient);

    df_project = ret.addField(TypeId(DimensionCostCenter));

    return ret;
}
</pre>


<p>Der so angepasste Dialog sollte wie folgt aussehen:
</p>


<p><img alt="Screenshot Dialog" height="176" src="http://www.schweda.net/pictures/blogpics/ax_dimensioncostcenter_dialog.jpg" title="Screenshot Dialog" width="333" />
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 19 Dec 2014 19:11:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=555</link>
<comments>https://www.schweda.net/blog_ax.php?bid=555</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=555</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=555</wfw:commentRss>
</item>
<item>
<title><![CDATA[Ursache von Fehlermeldungen ermitteln]]></title>
<description><![CDATA[
<p>In Dynamics AX k&ouml;nnen unterschiedliche (Fehler-)Meldungen auftreten, die meisten kommen von der Applikation, es gibt aber auch Meldungen, die vom AX-Client ausgegeben werden.
</p>

<p>Leider sind nicht alle Meldungen so sprechend, da&szlig; man (als Entwickler) sofort wei&szlig;, was nun zu tun ist. Deshalb gibt es, je nachdem um welche Art von Fehlermeldung es sich handelt, unterschiedliche Herangehensweisen, wie man die Ursache der Meldung findet.
</p>

<h2>Meldung &uuml;ber das Infolog der Applikation
</h2>

<p><a href="http://www.schweda.net/pictures/blogpics/ax_infolog_example_1.jpg"><img title="Screenshot infolog" border="0" alt="Screenshot Infolog" align="right" width="200" height="150" style="padding-bottom: 10px; padding-left: 10px" src="http://www.schweda.net/pictures/blogpics/tb_ax_infolog_example_1.jpg" /></a>Bei manchen Meldungen gen&uuml;gt ein Doppelklick auf die Meldung im <strong>Infolog </strong>und man landet im Code, welcher die Meldung geworfen hat (vorausgesetzt man befindet sich als Benutzer gerade im Entwicklungsmodus).
</p>
<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=513" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Mon, 09 Jun 2014 18:30:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=513</link>
<comments>https://www.schweda.net/blog_ax.php?bid=513</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=513</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=513</wfw:commentRss>
</item>
<item>
<title><![CDATA[Objekte per Code zu einem Projekt hinzufügen]]></title>
<description><![CDATA[
<p>Nachstehend ein kurzer Job, mit dessen Hilfe man AOT-Elemente zu einem bestehenden Shared Project hinzuf&uuml;gen kann.
</p>

<div class="div_blog_axcode">static void AddNodeToSharedProject(Args _args)<br />
{<br />
&nbsp;&nbsp;&nbsp; projectNode projectNode;<br />
&nbsp;&nbsp;&nbsp; TreeNode treeNode;<br />
&nbsp;&nbsp;&nbsp; #AOT<br />
&nbsp;&nbsp;&nbsp; #AOTExport <br />
<br />
&nbsp;&nbsp;&nbsp; projectNode&nbsp;&nbsp;&nbsp; = infolog.projectRootNode();<br />
&nbsp;&nbsp;&nbsp; projectNode&nbsp;&nbsp;&nbsp; = projectNode.AOTfindChild(#expProjectShared);<br />
&nbsp;&nbsp;&nbsp; projectNode&nbsp;&nbsp;&nbsp; = projectNode.AOTfindChild('MyProject');<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; // Add objects<br />
&nbsp;&nbsp;&nbsp; treenode = TreeNode::findNode(#TablesPath+'\\'+tableid2name(tablenum(CustGroup)));<br />
&nbsp;&nbsp;&nbsp; projectNode.addNode(treenode);<br />
<br />
&nbsp;&nbsp;&nbsp; treenode = TreeNode::findNode(#TablesPath+'\\'+tableid2name(tablenum(VendGroup)));<br />
&nbsp;&nbsp;&nbsp; projectNode.addNode(treenode);<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; treenode = TreeNode::findNode(#ClassesPath+'\\'+classStr(PriceDisc));<br />
&nbsp;&nbsp;&nbsp; projectNode.addNode(treenode);<br />
}
</div>

<p>Das ge&auml;nderte Projekt sieht beispielsweise wie folgt aus:
</p>

<p><img title="Screenshot" alt="Screenshot" style="padding-left: 10px" src="http://www.schweda.net/pictures/blogpics/ax_sharedprojectaddnode.jpg" border="0" align="left" height="158" width="245" />
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sat, 29 Mar 2014 19:28:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=504</link>
<comments>https://www.schweda.net/blog_ax.php?bid=504</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=504</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=504</wfw:commentRss>
</item>
<item>
<title><![CDATA[Werte eines Base-Enums durchlaufen]]></title>
<description><![CDATA[
<pre class="pre_blog_axcode">
SysDictEnum SysDictEnum = new SysDictEnum(enumNum(SalesStatus));
int i;

for (i=0;i&lt;SysDictEnum.values();i++)
{
    info(SysDictEnum.index2Label(i));
}
</pre>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Tue, 11 Mar 2014 21:20:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=478</link>
<comments>https://www.schweda.net/blog_ax.php?bid=478</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=478</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=478</wfw:commentRss>
</item>
<item>
<title><![CDATA[Makro innerhalb eines SELECT-Statements verwenden]]></title>
<description><![CDATA[
<p>Das Beispiel listet beispielsweise nur aktive St&uuml;cklistenpositionen (Tabelle <em>BOM</em>) auf (aktiv &uuml;ber die Felder <em>FromDate </em>und <em>ToDate</em>). L&auml;sst man den zweiten Parameter des Makros leer (dateNull()), so werden alle St&uuml;cklistenpositionen gelistet.
</p>


<pre class="pre_blog_axcode">
static void useMacroInSelectStatement(Args _args)
{
    bom bom;
    date emptyDate;
    
    // parameters: %1 = table instance, %2 date, %3 empty date value
    #localmacro.bomDateFilter
        &amp;&amp; ( %2 == dateNull() || (
            ((%1.FromDate &lt;= %2) &amp;&amp; (%1.ToDate &gt;= %2)) ||
            ((%1.FromDate == %3) &amp;&amp; (%1.ToDate == %3)) ||
            ((%1.FromDate &lt;= %2) &amp;&amp; (%1.ToDate == %3)) ||
            ((%1.FromDate == %3) &amp;&amp; (%1.ToDate &gt;= %2))
            ))
    #endMacro
    ;
    
    while select bom
    where bom.ItemId == &#39;123&#39;
    #bomDateFilter(bom, systemDateGet(), emptyDate)
    {
        info(bom.bomid);
    }
}
</pre>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sat, 25 Jan 2014 12:21:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=498</link>
<comments>https://www.schweda.net/blog_ax.php?bid=498</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=498</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=498</wfw:commentRss>
</item>
<item>
<title><![CDATA[Welche Felder werden in einem automatisch generierten Lookup angezeigt?]]></title>
<description><![CDATA[
<p>Mir wurde diese Frage vor&nbsp;kurzem selbst gestellt&nbsp;und konnte diese allerdings nur zum Teil beantworten.
</p>

<p>Ich wusste aber noch, da&szlig; ich schon einmal eine Seite gesehen hatte, wo dies genau erkl&auml;rt wird. Aber ich wusste weder noch wo, noch konnte ich sie &uuml;ber diverse Suchmaschinen finden.
</p>

<p>Aber in alten Unterlagen fand ich die Quelle dann doch, der Trick um die Quelle auch mit Google und Konsorten zu finden ist, mit dem altem Namen von Microsoft Dynamics AX - <strong>Axapta </strong>danach zu suchen!
</p>

<p>Tut man dies, so findet man rasch folgende Seite:
</p>

<p><a title="Axaptapedia" target="_blank" href="http://www.axaptapedia.com/index.php?title=Lookups">http://www.axaptapedia.com/index.php?title=Lookups</a>
</p>
<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=500" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Thu, 16 Jan 2014 21:43:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=500</link>
<comments>https://www.schweda.net/blog_ax.php?bid=500</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=500</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=500</wfw:commentRss>
</item>
<item>
<title><![CDATA[Erstellen einer AX<Table>-Klasse]]></title>
<description><![CDATA[
<p>Ben&ouml;tigt man f&uuml;r eine Tabelle eine sog. <strong>AX&lt;Table&gt;-Klasse</strong> kann man sich diese mit Hilfe der Klasse <strong>AxGenerateAxBCClass </strong>generieren lassen.
</p>


<p>Dazu einfach diese Klasse im AOT&nbsp;per rechter Maustaste aufrufen und dem Assistenten folgen.
</p>


<p>Die auf diese Art &amp;&nbsp;Weise generierte Klasse muss unter manchen Umst&auml;nden noch etwas bearbeitet werden, dennoch geht der Vorgang rascher von der Hand, als die Klasse komplett selbst erstellen zu m&uuml;ssen.
</p>


<p>Und wenn sich die Tabelle &auml;ndert, beispielweise wenn neue Felder hinzukommen, kann man die <strong>AxGenerateAxBCClass </strong>einfach nochmals aufrufen und die AX&lt;Table&gt;-Klasse wird entsprechend erweitert.
</p>


<p>Wie man solche AX&lt;Table&gt;-Klassen verwendet, habe ich u.a. <a href="http://www.schweda.net/blog_ax.php?bid=494" target="_self" title="Erstellen einer Entität per Code">hier beschrieben</a>.
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Tue, 12 Nov 2013 15:27:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=495</link>
<comments>https://www.schweda.net/blog_ax.php?bid=495</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=495</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=495</wfw:commentRss>
</item>
<item>
<title><![CDATA[Beispiel für einen Datumsfilter einer FormDataSource]]></title>
<description><![CDATA[
<p>Im folgenden ein Beispiel, wie man bei einer FormDataSource einen QueryBuildRange aufbaut, welcher nur tagesaktuelle Datens&auml;tze anzeigt.
</p>

<p>Im Beispiel enth&auml;lt unsere FormDataSource namens <em>DataSourceName </em>zwei Datumsfelder namens <em>FromDate </em>und <em>ToDate </em>und es sollen abh&auml;ngig von einer Checkbox nur Datens&auml;tze angezeigt werden, die &quot;heute&quot; g&uuml;ltig sind.
</p>

<div class="div_blog_axcode">public void applyFilter()<br />
{<br />
&nbsp;&nbsp;&nbsp; queryBuildRange qbr;<br />
<br />
&nbsp;&nbsp;&nbsp; qbr = sysQuery::findOrCreateRange(DataSourceName_ds.queryBuildDataSource(), fieldNum(DataSourceName, recId));<br />
<br />
&nbsp;&nbsp;&nbsp; if( !ShowExpiredCheckBox.checked())<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qbr.value(strfmt('('+<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '((%5.%2 &lt;= %1) &amp;&amp; (%5.%3 &gt;= %1)) || ' +<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '((%5.%2 == %4) &amp;&amp; (%5.%3 == %4)) || ' +<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '((%5.%2 &lt;= %1) &amp;&amp; (%5.%3 == %4)) || ' +<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '((%5.%3 &gt;= %1) &amp;&amp; (%5.%2 == %4)) ' +<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ')',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date2StrXpp(systemDateGet()),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fieldstr(DataSourceName, FromDate),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fieldstr(DataSourceName, ToDate),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date2StrXpp(dateNull()),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tableId2name(tableNum(DataSourceName))));<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; else<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qbr.value(SysQuery::valueUnlimited());<br />
&nbsp;&nbsp;&nbsp; }<br />
}
</div>

<p>Der Aufruf obiger Methode kann beispielsweise in der <em>executeQuery()</em> der Datasource erfolgen.
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sun, 01 Sep 2013 15:43:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=475</link>
<comments>https://www.schweda.net/blog_ax.php?bid=475</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=475</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=475</wfw:commentRss>
</item>
<item>
<title><![CDATA[Text-Datei per X++ drucken]]></title>
<description><![CDATA[
<p>Ein kurzes Beispiel, wie man aus AX heraus via Notepad eine Text-Datei ausdrucken kann.
</p>


<pre class="pre_blog_axcode">
static void printTextFileFromAX(Args _args)
{
    WinAPI::shellExecute(&quot;c:&#092;&#092;windows&#092;&#092;system32&#092;&#092;NOTEPAD.EXE&quot;,  @&#39;/pt &quot;c:&#092;temp&#092;test.txt&quot; &quot;An OneNote 2010 senden&quot;&#39;);
}
</pre>


<p>Hinweise: &quot;An OneNote 2010 senden&quot; ist dabei der Name des Druckers. Das Beispiel wurde in Dynamics AX 2012 verwendet, sollte allerdings auch in fr&uuml;heren Versionen verwendbar sein.
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Thu, 11 Jul 2013 20:50:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=471</link>
<comments>https://www.schweda.net/blog_ax.php?bid=471</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=471</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=471</wfw:commentRss>
</item>
<item>
<title><![CDATA[Berichte lassen sich nicht über die Stapelverarbeitung ausführen]]></title>
<description><![CDATA[
<p>Wenn bei einem Benutzer der Register Stapel beim Aufruf eines Berichtes nicht angezeigt wird, kann dies u.U. daran liegen, da&szlig; der Benutzer keine oder unzureichende&nbsp;Berechtigung f&uuml;r den Sicherheitsschl&uuml;ssel <em>Stapelverarbeitungsbericht</em> (SecurityKey <em>BatchReport</em>) hat.
</p>


<p><img alt="" height="206" src="http://www.schweda.net/pictures/blogpics/axReportBatchTab.jpg" title="Screenshot" width="465" />
</p>


<p><br />
&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Wed, 06 Jul 2011 19:24:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=411</link>
<comments>https://www.schweda.net/blog_ax.php?bid=411</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=411</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=411</wfw:commentRss>
</item>
<item>
<title><![CDATA[Berechtigung eines Benutzers für einen Sicherheitsschlüssel abfragen]]></title>
<description><![CDATA[
<p>Mit diesem St&uuml;ckchen Code kann man in Dynamics AX pr&uuml;fen, welche Berechtigung ein Benutzer f&uuml;r einen bestimmten Sicherheitsschl&uuml;ssel (Securitykey) hat.
</p>

<div class="div_blog_axcode">static void GetSecurityKeyAccess4User(Args _args)<br />
{<br />
&nbsp;&nbsp;&nbsp; Dictionary&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dictionary = new Dictionary();<br />
&nbsp;&nbsp;&nbsp; securityKeyId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; securityKeyId;<br />
&nbsp;&nbsp;&nbsp; SecurityKeySet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; securityKeySet = new SecurityKeySet();<br />
&nbsp;&nbsp;&nbsp; UserId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; userId = 'user1';<br />
&nbsp;&nbsp;&nbsp; SelectableDataArea&nbsp; dataArea = 'ceu';<br />
&nbsp;&nbsp;&nbsp; AccessType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; accessType;<br />
&nbsp;&nbsp;&nbsp; ;<br />
<br />
&nbsp;&nbsp;&nbsp; securityKeyId = Dictionary.securityKeyName2Id(&quot;BatchReport&quot;);<br />
<br />
&nbsp;&nbsp;&nbsp; securityKeySet.loadUserRights(userId, dataArea);<br />
<br />
&nbsp;&nbsp;&nbsp; AccessType = securityKeySet.access(securityKeyId);<br />
<br />
&nbsp;&nbsp;&nbsp; info(enum2str(AccessType));<br />
}
</div>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 24 Jun 2011 20:49:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=410</link>
<comments>https://www.schweda.net/blog_ax.php?bid=410</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=410</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=410</wfw:commentRss>
</item>
<item>
<title><![CDATA[Tabellen mit doppelten RecIDs ermitteln]]></title>
<description><![CDATA[
<p>Wenn man in Dynamics AX (4.0&nbsp;bzw. 2009) einmal in die Verlegenheit kommen sollte, pr&uuml;fen zu m&uuml;ssen, ob es Tabellen mit doppelten RecIDs gibt, kann folgendes SQL-Script dabei behilflich sein:
</p>

<div class="div_blog_sqlcode">use ax2009_standard_sp1<br />
<br />
set nocount on<br />
<br />
declare @tableName char(100)<br />
declare&nbsp;db_cursor CURSOR FOR&nbsp; <br />
&nbsp;select name from dbo.sysobjects<br />
&nbsp;where xtype = 'U'<br />
&nbsp;and name &lt;&gt; 'ROWSTAT'<br />
&nbsp;and name &lt;&gt; 'ROWSTATUS'<br />
&nbsp;and name &lt;&gt; 'SQLSYSTEMVARIABLES'<br />
&nbsp;and name &lt;&gt; 'SYSTEMSEQUENCES'&nbsp;-- SYSTEMSEQUENCES enth&auml;lt immer doppelte RecIDs<br />
&nbsp;order by name asc<br />
<br />
-- Tempor&auml;re Tabelle aufbauen<br />
IF OBJECT_ID(N'tempdb..#tmp_duplrecid', N'U') IS NOT NULL <br />
&nbsp;begin<br />
&nbsp;drop table #tmp_duplrecid<br />
&nbsp;end<br />
<br />
create table #tmp_duplrecid (tablename char(100), recordcounter bigint)&nbsp;&nbsp;&nbsp;<br />
<br />
OPEN db_cursor&nbsp;&nbsp; <br />
FETCH NEXT FROM db_cursor INTO @tableName&nbsp;&nbsp;<br />
<br />
WHILE @@FETCH_STATUS = 0&nbsp;&nbsp; <br />
&nbsp;BEGIN&nbsp;&nbsp; <br />
&nbsp;&nbsp;-- Tabellen mit doppelten RecIds ermitteln<br />
&nbsp;&nbsp;exec('insert into #tmp_duplrecid select ''' + @tableName + ''', COUNT(*)' + <br />
&nbsp;&nbsp;&nbsp; ' from ' + @tableName +<br />
&nbsp;&nbsp;&nbsp; ' group by RECID ' + <br />
&nbsp;&nbsp;&nbsp; ' having COUNT(*) &gt; 1')<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;FETCH NEXT FROM db_cursor INTO @tableName&nbsp;&nbsp; <br />
&nbsp;END&nbsp;&nbsp;<br />
<br />
CLOSE db_cursor&nbsp;&nbsp; <br />
DEALLOCATE db_cursor<br />
<br />
set nocount off<br />
<br />
-- Tabellen mit doppelten RecIDs<br />
select 'Tabelle enth&auml;lt doppelte RecIDs: ' + tablename<br />
from #tmp_duplrecid
</div>

<p><br />
&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Wed, 04 May 2011 20:06:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=407</link>
<comments>https://www.schweda.net/blog_ax.php?bid=407</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=407</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=407</wfw:commentRss>
</item>
<item>
<title><![CDATA[Praktisches Beispiel für die Verwendung des runBaseBatch-Frameworks]]></title>
<description><![CDATA[
<p>Vor einiger Zeit habe ich schon einmal einen <a href="http://www.schweda.net/blog_ax.php?nid=runbasebatch1" target="_self" title="Das runBaseBatch-Framework">Eintrag &uuml;ber das runBaseBatch-Framework</a> geschrieben, damals ging&#39;s haupts&auml;chlich um die Aufrufreihenfolge der einzelnen Methoden und wof&uuml;r einige von diesen Methoden verwendet werden k&ouml;nnen bzw. verwendet werden sollten.
</p>


<p>Nun habe ich mir basierend auf diesem Eintrag und vor allem aufgrund von Erfahrungswerten eine eigene Klasse namens <strong>t</strong><strong>utorial_ClassWithQueryRun</strong> geschrieben, die einige oft ben&ouml;tigte Anforderungen vereinigt.
</p>


<p>Diese Klasse vereint folgende F&auml;higkeiten:
</p>


<ul>
	
<li>Stapelf&auml;higkeit
</li>
	
<li>Arbeiten mit einem Query
</li>
	
<li>Arbeiten mit den Nutzungsdaten
</li>
	
<li>Schreiben einer Datei via textIo
</li>
	
<li>Arbeiten mit Fortschrittsanzeigen (progress)
</li>

</ul>


<p><a href="http://www.schweda.net/pictures/blogpics/Tutorial_ClassWithQueryRun.jpg" rel="lightbox" target="_blank"><img alt="Screenshot" height="176" src="http://www.schweda.net/pictures/blogpics/Tutorial_ClassWithQueryRun_small.jpg" title="Screenshot" width="465" /></a>
</p>

<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=403" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sun, 20 Mar 2011 11:46:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=403</link>
<comments>https://www.schweda.net/blog_ax.php?bid=403</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=403</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=403</wfw:commentRss>
</item>
<item>
<title><![CDATA[Fehler beim Aufrufen des ActiveX-Controls NETRONIC VARCHART XGantt in Dynamics AX]]></title>
<description><![CDATA[
<p>Ich habe mich schon seit l&auml;ngerem &uuml;ber&nbsp;zahlreiche Fehlermeldungen gewundert, die immer dann aufgetreten sind, wenn ich ein Formular ge&ouml;ffnet habe wo das ActiveX-Control <strong>NETRONIC VARCHART XGantt</strong> eingebettet war, z.B. das Formular Simultanplanungslauf.
</p>

<p>Folgende Fehlermeldungen hatte ich da am Bildschirm:
</p>

<blockquote>ActXBaseControl::Open failure<br />
<br />
D\Work\Projects\Ganft <br />
4.O\NewGanttChart\NewGanttC ha rt_ActiveXsettings\GanttReqTransExplosioniFD<br />
<br />
Loading the interface with identifier GanttReqTransExplosion failed<br />
<br />
This is an unlicensed version of NETRONIC VARCHART XGantt. 1 Please contact NETRONIC for a Iicensed version.
</blockquote>

<p>Eigentlich ist die L&ouml;sung&nbsp;ganz einfach! Ich arbeite&nbsp;nat&uuml;rlich auf einer Entwickler-Maschine, wo&nbsp;unterschiedlichste Versionen von Dynamcs AX/Axapta parallel installiert sind. Und die zuerst installierte und somit &auml;lteste Version&nbsp;bestimmt die aktuell verwendete Version&nbsp;der&nbsp;ActiveX-Komponente.
</p>

<p>Also ist&nbsp;folgendes zu tun: Deinstallieren der &quot;veralteten&quot;&nbsp;Version und installieren bzw. registrieren einer neueren Version z.B. &uuml;ber die Kommandozeile.
</p>

<blockquote>REM Uninstall old version<br />
regsvr32.exe /u &quot;C:\Program Files\Microsoft Business Solutions\Axapta\Client\Bin\vcgantt.ocx&quot;<br />
<br />
REM Install new version<br />
regsvr32.exe &quot;C:\Program Files\Microsoft Dynamics AX\Common\vcgantt.ocx&quot;
</blockquote>

<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sat, 09 Oct 2010 11:25:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=392</link>
<comments>https://www.schweda.net/blog_ax.php?bid=392</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=392</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=392</wfw:commentRss>
</item>
<item>
<title><![CDATA[Shared Project mit X++ erstellen II]]></title>
<description><![CDATA[
<p>In einem <a title="Shared Project mit X++ erstellen" target="_self" href="http://www.schweda.net/blog_ax.php?nid=sharedproject1">fr&uuml;heren Beitrag</a> habe ich ja hier schon einen Job ver&ouml;ffentlicht, mit dessen Hilfe man sich per X++ ein Shared Project erstellen kann. Basierend auf der neu <a title="selectMultiple und selectSingle" target="_self" href="http://www.schweda.net/blog_ax.php?nid=selectmultiple">entdeckten Funktion selectMultiple</a> habe ich diesen nun etwas erweitert, der Benutzer hat mit dessen Hilfe nun die M&ouml;glichkeit, ein Shared Project zu erstellen und dabei f&uuml;r die aktuell ben&ouml;tigten Datentypen eigene Gruppenknoten innerhalb dieses Projektes zu erstellen.
</p>

<div class="div_blog_axcode">static void CreateSharedProjectUsingSelectMultiple(Args _args)<br />
{<br />
&nbsp;&nbsp;&nbsp; DictEnum&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DictEnum;<br />
&nbsp;&nbsp;&nbsp; container&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; conValues;<br />
&nbsp;&nbsp;&nbsp; container&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; conSelectedValues;<br />
&nbsp;&nbsp;&nbsp; container&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; conSelectMultiple;<br />
&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i;<br />
&nbsp;&nbsp;&nbsp; projectNode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; projectNode;<br />
&nbsp;&nbsp;&nbsp; projectGroupNode&nbsp;&nbsp;&nbsp; projectGroupNode;<br />
&nbsp;&nbsp;&nbsp; projectNode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myProjectNode;<br />
&nbsp;&nbsp;&nbsp; treeNodeName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nameOfProject;<br />
&nbsp;&nbsp;&nbsp; groupNodeType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; groupNodeType;<br />
&nbsp;&nbsp;&nbsp; treeNodeName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; groupNodeName;<br />
&nbsp;&nbsp;&nbsp; dialog&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dialog;<br />
&nbsp;&nbsp;&nbsp; dialogField&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dfProjectName;<br />
&nbsp;&nbsp;&nbsp; #AOTExport<br />
&nbsp;&nbsp;&nbsp; ;<br />
&nbsp;&nbsp;&nbsp; // Create dialog<br />
&nbsp;&nbsp;&nbsp; dialog = new dialog();<br />
&nbsp;&nbsp;&nbsp; dfProjectName = dialog.addFieldValue(typeId(treeNodeName), &quot;NameOfproject&quot;, &quot;Name of project&quot;);<br />
&nbsp;&nbsp;&nbsp; if( !dialog.run())<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; nameOfProject = dfProjectName.value() ? dfProjectName.value() : &quot;Unknown&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp; // Add available values to container<br />
&nbsp;&nbsp;&nbsp; DictEnum = new DictEnum(enumName2Id(identifierStr(GroupNodeType)));<br />
&nbsp;&nbsp;&nbsp; for(i=1;i&lt;DictEnum.values();i++)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; conValues = conIns(conValues, conLen(conValues)+1, [DictEnum.index2Label(i), i, false]);<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; // Call selectMultiple<br />
&nbsp;&nbsp;&nbsp; conSelectMultiple = selectMultiple(&quot;Please select&quot;, &quot;Please select the needed project-groups&quot;, conValues);<br />
&nbsp;&nbsp;&nbsp; conSelectedValues = conPeek(conSelectMultiple, 2);<br />
&nbsp;&nbsp;&nbsp; if( !conPeek(conSelectMultiple, 1))<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; // Create shared project<br />
&nbsp;&nbsp;&nbsp; projectNode&nbsp;&nbsp;&nbsp; = infolog.projectRootNode();<br />
&nbsp;&nbsp;&nbsp; projectNode&nbsp;&nbsp;&nbsp; = projectNode.AOTfindChild(#expProjectShared);<br />
&nbsp;&nbsp;&nbsp; myProjectNode&nbsp; = projectNode.AOTfindChild(nameOfProject);<br />
<br />
&nbsp;&nbsp;&nbsp; if( !myProjectNode)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myProjectNode = projectNode.AOTadd(nameOfProject);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myProjectNode.AOTsave();<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; myProjectNode&nbsp;&nbsp;&nbsp;&nbsp; = myProjectNode.getRunNode();<br />
<br />
&nbsp;&nbsp;&nbsp; if(conPeek(conSelectMultiple, 1))<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=1; i&lt;=conLen(conSelectedValues); i++)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; groupNodeName = DictEnum.index2Label(conPeek(conSelectedValues, i));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; projectGroupNode = myProjectNode.AOTfindChild(groupNodeName);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( !projectGroupNode)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myProjectNode.AOTadd(groupNodeName);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; projectGroupNode = myProjectNode.AOTfindChild(groupNodeName);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; projectGroupNode.projectGroupType(DictEnum.name2Value(groupNodeName));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myProjectNode.AOTsave();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; projectGroupNode.AOTsave();<br />
<br />
&nbsp;&nbsp;&nbsp; myProjectNode.AOTsave();<br />
&nbsp;&nbsp;&nbsp; myProjectNode.AOTrefresh();<br />
&nbsp;&nbsp;&nbsp; myProjectNode.AOTrun();<br />
}
</div>

<p>Obiger Code funktioniert meines Wissens nach in Dynamics AX 4.0 und Dynamics AX 2009.
</p>

<p>&nbsp;
</p>

<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Thu, 05 Aug 2010 19:15:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=391</link>
<comments>https://www.schweda.net/blog_ax.php?bid=391</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=391</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=391</wfw:commentRss>
</item>
<item>
<title><![CDATA[Palette verlagern per X++]]></title>
<description><![CDATA[
<p>Folgend etwas X++ Code, mit dessen Hilfe man eine Palette verlagern kann, also genau das, was die Schaltfl&auml;che &quot;Palette verlagern&quot; in Formular Palette tut.
</p>

<div class="div_blog_axcode">WMSPalletMove wmsPalletMove = <span style="color: rgb(0,0,255)">new</span> wmsPalletMove();<br />
wmsPalletMove.parmWMSPalletId(<span style="color: rgb(255,0,0)">'00000022_117'</span>);<br />
wmsPalletMove.parmToInventLocationId(<span style="color: rgb(255,0,0)">'300'</span>);<br />
wmsPalletMove.parmToLocationId(<span style="color: rgb(255,0,0)">'01'</span>);<br />
<span style="color: rgb(0,0,255)">if</span>(wmsPalletMove.validate())<br />
{<br />
&nbsp;&nbsp; wmsPalletMove.run();<br />
}
</div>

<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sat, 31 Jul 2010 18:11:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=370</link>
<comments>https://www.schweda.net/blog_ax.php?bid=370</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=370</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=370</wfw:commentRss>
</item>
<item>
<title><![CDATA[Zugriff auf die Zwischenablage per X++]]></title>
<description><![CDATA[
<p>In Dynamics AX kann man selbstverst&auml;ndlich auch auf die Zwischenablage zugreifen, ein kurzes Codebeispiel dazu im folgenden. Funktioniert &uuml;brigens zumindest seit Axpata 2.5.
</p>

<div class="div_blog_axcode"><span style="color: rgb(0, 0, 255);">static void</span> useClipboard(Args _args)<br />
{<br />
&nbsp;&nbsp;&nbsp; textBuffer&nbsp; textBuffer = <span style="color: rgb(0, 0, 255);">new</span> textBuffer();<br />
&nbsp;&nbsp;&nbsp; ; &nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 102, 0);"><br />
&nbsp;&nbsp;&nbsp; // Write to clipboard</span><br />
&nbsp;&nbsp;&nbsp; textBuffer.appendText(<span style="color: rgb(255, 0, 0);">'Hello world!'</span>);<br />
&nbsp;&nbsp;&nbsp; textBuffer.toClipboard();<br />
<br />
&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 102, 0);">// Read from clipboard</span><br />
&nbsp;&nbsp;&nbsp; textBuffer.fromClipboard();<br />
&nbsp;&nbsp;&nbsp; <span style="color: rgb(0, 0, 255);">info</span>(textBuffer.getText());<br />
}
</div>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 26 Mar 2010 19:49:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=371</link>
<comments>https://www.schweda.net/blog_ax.php?bid=371</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=371</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=371</wfw:commentRss>
</item>
<item>
<title><![CDATA[Notizen zur RecId]]></title>
<description><![CDATA[
<p>Die RecId ist die mehr oder weniger eindeutige Kennung eines Datensatzes in Dynamics AX. Mehr oder weniger deshalb, weil es auf die verwendete Version von Dynamics AX bzw. Axapta ankommt:
</p>


<table class="table_blog_main_content">
	<tbody>
		<tr>
			
<th>Version
</th>
			
<th>Bemerkung
</th>
		</tr>
		<tr>
			
<td>3.0
</td>
			
<td>RecId pro Mandant eindeutig (&uuml;ber alle Tabellen)
</td>
		</tr>
		<tr>
			
<td>4.0
</td>
			
<td>RecId pro Tabelle eindeutig (&uuml;ber alle Mandanten)<br />
			D.h. die selbe RecId kann in zwei oder mehreren Tabellen vorkommen, das ist auch der Grund, warum ein Feld einer Tabelle vom Typ RefRecId als EDT mit einer Relation abgebildet werden muss!
</td>
		</tr>
		<tr>
			
<td>2009
</td>
			
<td>Wie&nbsp;bei Version&nbsp;4.0
</td>
		</tr>
		<tr>
			
<td>2012
</td>
			
<td>Wie&nbsp;bei Version&nbsp;4.0
</td>
		</tr>
	</tbody>

</table>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Thu, 04 Mar 2010 19:37:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=361</link>
<comments>https://www.schweda.net/blog_ax.php?bid=361</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=361</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=361</wfw:commentRss>
</item>
<item>
<title><![CDATA[Unterschied zwischen update und doUpdate u.ä.]]></title>
<description><![CDATA[
<p>Mir pers&ouml;nlich dreht sich ja immer der Magen um, wenn ich in einer Produktivumgebung einen St&uuml;ckchen Code mit <em>doUpdate() </em>oder Konsorten entdecke, trotzdem verwende ich solcherart Methoden auch gerne f&uuml;r den einen oder anderen Aktualisierungsjob. Wer den Unterschied zwischen dem Aufruf von <em>update() </em>und <em>doUpdate()</em> nicht kennt, kann diesen in der MSDN nachlesen...oder aber auch in der nachstehenden Tabelle.
</p>


<table border="0" cellpadding="0" cellspacing="0" class="table_blog_main_content">
	
<thead>
		<tr>
			
<th scope="col">Methode
</th>
			
<th scope="col">Bemerkung
</th>
		</tr>
	
</thead>
	<tbody>
		<tr>
			
<td>insert vs. doInsert
</td>
			
<td>Bei Verwendung von doInsert wird die insert-Methode der Tabelle nicht aufgerufen
</td>
		</tr>
		<tr>
			
<td>delete vs. doDelete
</td>
			
<td>Bei Verwendung von doDelete wird eine &uuml;berschriebene delete-Methode der Tabelle nicht aufgerufen, sondern nur die delete-Methode des xRecord. D.h. DeleteActions werden dennoch ausgef&uuml;hrt
</td>
		</tr>
		<tr>
			
<td>update vs. doUpdate
</td>
			
<td>Bei Verwendung von doUpdate wird die update-Methode der Tabelle nicht aufgerufen
</td>
		</tr>
	</tbody>

</table>


<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Thu, 11 Feb 2010 19:31:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=364</link>
<comments>https://www.schweda.net/blog_ax.php?bid=364</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=364</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=364</wfw:commentRss>
</item>
<item>
<title><![CDATA[Eintrag "Einstellungen" im Kontextmenü freischalten]]></title>
<description><![CDATA[
<p style="text-align: left"><img alt="Kontextmen&uuml; von AX2009" align="right" width="223" height="209" style="margin-bottom: 10px; border-top: 1px solid; border-right: 1px solid; border-bottom: 1px solid; margin-left: 10px; border-left: 1px solid" src="http://www.schweda.net/pictures/blogpics/ax2009_contextmenu_settings.jpg" />Jeder Entwickler kennt ihn und die meisten benutzen ihn auch regelm&auml;ssig: Den Eintrag &quot;Einstellungen&quot; im Kontextmen&uuml; eines Formulares.
</p>

<p>Wie man diesen Eintrag &uuml;ber die Berechtigungsverwaltung von Dynamics AX entfernt oder hinzuf&uuml;gt, wusste ich allerdings bis dato nicht. Erst ein Request beim Hersteller, den ein Kollege abgesetzt hat, hat mich auf die richtige Spur gebracht:
</p>

<p>Unter <strong>Sicherheit / Verwaltung / Sonstiges / Fomular &quot;Personalisierung&quot;</strong> muss man die Berechtigung auf mindestens &quot;Bearbeiten&quot; setzen, damit der Eintrag im Kontextmen&uuml; aufscheint.
</p>

<p>Und jetzt erkl&auml;r mir mal einer, wie man das selbst finden soll...
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Thu, 04 Feb 2010 21:00:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=366</link>
<comments>https://www.schweda.net/blog_ax.php?bid=366</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=366</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=366</wfw:commentRss>
</item>
<item>
<title><![CDATA[Versenden einer Mail an alle Online-Benutzer in Dynamics AX 4.0 und AX 2009]]></title>
<description><![CDATA[
<p>Folgende Schritte sind in Dynamics AX notwendig, um allen Online-Benutzern eine E-Mail zu senden:
</p>

<ol>
    
<li>Eintragen des zu verwendenden SMTP-Servers unter <strong>Verwaltung / Einstellungen / E-Mail-Parameter</strong>
</li>
    
<li>Erstellen eines E-Mail-Vorlage vom Typ System unter <strong>Grundeinstellungen / Einstellungen /&nbsp; E-Mail-Vorlage<br />
    </strong>Hier kann der Betreff und der Text der zu versendenden Mail um den Platzhalter %username% erweitert werden.
</li>
    
<li>Versenden der Mail unter <strong>Verwaltung / Periodisch / E-Mail-Aussendung</strong>
</li>

</ol>

<p>Man kann auch an alle Benutzer einer Installation versenden.
</p>

<p>F&uuml;r technisch Interessierte: Die verantwortliche Klasse ist die <em>SysEmailBroadCast</em>.
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Tue, 19 Jan 2010 09:20:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=365</link>
<comments>https://www.schweda.net/blog_ax.php?bid=365</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=365</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=365</wfw:commentRss>
</item>
<item>
<title><![CDATA[Was man bei Base Enums beachten sollte]]></title>
<description><![CDATA[
<p>Schon einmal einen Base Enum in Dynamics AX erstellt? Oder einen bestehenden erweitert?
</p>


<p>Ja?! Dabei auch auf das folgende geachtet?
</p>


<p><strong>.) Das erste Element eines Base Enums sollte den Wert 0 aufweisen</strong> und dieser sollte &quot;Undefiniert&quot;, &quot;Kein&quot;, &quot;Unbekannt&quot; oder &auml;hnlichem entsprechen. Vor allem wenn man den Base Enum sp&auml;ter in Tabellen verwenden m&ouml;chte, die bereits Daten enthalten.<br />
Selbst wenn man davon ausgehen kann, da&szlig; man einen solchen undefinierten Zustand nicht ben&ouml;tigt, sollte man die 0 reserviert halten, sprich der erste &quot;echte&quot; Wert des Base Enums sollte 1 entsprechen.
</p>

<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=345" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Mon, 21 Dec 2009 19:04:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=345</link>
<comments>https://www.schweda.net/blog_ax.php?bid=345</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=345</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=345</wfw:commentRss>
</item>
<item>
<title><![CDATA[PageFooter sind nicht immer dort, wo sie sein sollten]]></title>
<description><![CDATA[
<p>Ich kenne kein einziges AX-Projekt, in dem nicht zumindest einer der Berichte Auftragsbest&auml;tigung, Ausgangslieferschein oder Ausgangsrechnung angepasst worden sind. Und deshalb stolpere ich auch immer wieder &uuml;ber das selbe Problem: Man erweitert einen Bericht (Report) um einen PageFooter, der aber nicht auf jeder Seite angedruckt werden soll.
</p>
<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=360" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 04 Dec 2009 17:34:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=360</link>
<comments>https://www.schweda.net/blog_ax.php?bid=360</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=360</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=360</wfw:commentRss>
</item>
</channel>
</rss>	
