<?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?cid=7" rel="self" type="application/rss+xml" />
<item>
<title><![CDATA["OpenPrinter"-Fehler beim Anzeigen eines Berichtes am Bildschirm]]></title>
<description><![CDATA[
<p>Wenn beim Anzeigen eines Berichtes am Bildschirm folgender Fehler auftritt, muss man im Windows einen Standarddrucker einrichten.
</p>


<blockquote>

<p>OpenPrinter_1: rc:0 LastError:3012(0xbc4) Es wurden keine Drucker gefunden.
</p>

</blockquote>


<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Wed, 16 Feb 2022 10:58:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=706</link>
<comments>https://www.schweda.net/blog_ax.php?bid=706</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=706</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=706</wfw:commentRss>
</item>
<item>
<title><![CDATA[Kommissionierliste eines Verkaufsauftrages per Code erfassen]]></title>
<description><![CDATA[
<div class="div_table_100_wo_border">

<div class="div_tablerow">

<div class="div_tablecolumn" style="padding-right:10px">

<p>Das nachstehende Code-Beispiel zeigt. wie man per Code eine Erfassung f&uuml;r eine Kommissionierliste buchen kann (in der Annahme da&szlig; beispielsweise alle notwendigen Informationen wie Entnahmelagerplatz usw. bereits eingetragen wurden).
</p>

</div>


<div class="div_tablecolumn" style="width:40%">

<p><a href="http://www.schweda.net/pictures/blogpics/ax2012_salespickinglist_register.png" rel="lightbox" target="_self"><img alt="Screenshot" height="166" src="http://www.schweda.net/pictures/blogpics/ax2012_salespickinglist_register.png" title="Screenshot" width="396" /></a>
</p>

</div>

</div>

</div>


<pre class="pre_blog_axcode">
static void pickingListRegistration(Args _args)
{
    WMSPickingRouteID pickingRouteID = &quot;00061&quot;;    // Route id to be picked
    List list = new List(Types::String);

    list.addEnd(pickingRouteID);

    WMSPickingRoute::finishMulti(list.pack());

    wmsDeliverPickedItems::checkDeliverPickedItems(pickingRouteID, list.pack());
}
</pre>


<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Mon, 27 Apr 2020 10:30:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=530</link>
<comments>https://www.schweda.net/blog_ax.php?bid=530</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=530</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=530</wfw:commentRss>
</item>
<item>
<title><![CDATA[Kommissionierliste für bestimmte Positionen eines Verkaufsauftrages erstellen]]></title>
<description><![CDATA[
<div class="div_table_100_wo_border">

<div class="div_tablerow">

<div class="div_tablecolumn" style="padding-right:10px">

<p>Ich kenne keine M&ouml;glichkeit, wie man eine Kommissionierliste nur f&uuml;r bestimmte Auftragspositionen per Code erstellt.
</p>


<p>Deshalb nutze ich in dem folgenden Code-Beispiel folgenden Ansatz:
</p>


<p>Ich erstelle&nbsp;die Kommissionierliste mit Hilfe des SalesFormLetter-Frameworks und l&ouml;sche vor dem entscheidenden Schritt (dem Ausf&uuml;hren der run()-Methode) jene Eintr&auml;ge in der Tabelle SalesParmLine, die ich nicht ben&ouml;tigte.
</p>

</div>


<div class="div_tablecolumn" style="width:40%">

<p><a href="http://www.schweda.net/pictures/blogpics/ax2012_salespickinglist_create.png" rel="lightbox" target="_self"><img alt="Screenshot" height="166" src="http://www.schweda.net/pictures/blogpics/ax2012_salespickinglist_create.png" title="Screenshot" width="396" /></a>
</p>

</div>

</div>

</div>


<pre class="pre_blog_axcode">
static void createSalesPickingListSingleLine(Args _args)
{
    SalesTable salesTable = salesTable::find(&quot;001862&quot;); // Sales order
    container inventTransIdCon = [&quot;014015&quot;, &quot;014016&quot;];  // LOT-IDs to pick
    SalesFormLetter salesFormLetter;
    SalesParmLine salesParmLine;
    
    salesFormLetter = SalesFormLetter::construct(DocumentStatus::PickingList);

    // Do the steps manually, which normally are done in method
    // salesFormLetter.update()
    salesFormLetter.salesTable(salesTable);
    salesFormLetter.initParmSalesTable(salesFormLetter.salesTable());
    salesFormLetter.transDate(systemDateGet());
    salesFormLetter.specQty(SalesUpdate::All);
    salesFormLetter.proforma(salesFormLetter.salesParmUpdate().Proforma);
    salesFormLetter.printFormLetter(salesFormLetter.printFormLetter());
    salesFormLetter.printCODLabel(NoYes::No);
    salesFormLetter.printShippingLabel(NoYes::No);
    salesFormLetter.usePrintManagement(false);
    salesFormLetter.creditRemaining(salesFormLetter.creditRemaining());

    salesFormLetter.createParmUpdateFromParmUpdateRecord(
        SalesFormletterParmData::initSalesParmUpdateFormletter(
            salesFormLetter.documentStatus(),
            salesFormLetter.pack(),
            true,
            false,
            false));

    salesFormLetter.initParameters(
        salesFormLetter.salesParmUpdate(),
        Printout::Current);

    salesFormLetter.initLinesQuery();

    // Delete unwanted records in SalesParmLine
    while select forupdate salesParmLine
        where salesParmLine.ParmId == salesFormLetter.parmId()
    {
        if (conFind(inventTransIdCon, salesParmLine.InventTransId) == 0)
        {
            salesParmLine.delete();
        }
    }

    // Let&#39;s go
    salesFormLetter.run();
}
</pre>


<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Mon, 27 Apr 2020 10:30:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=529</link>
<comments>https://www.schweda.net/blog_ax.php?bid=529</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=529</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=529</wfw:commentRss>
</item>
<item>
<title><![CDATA[Kommissionierliste für alle Positionen eines Verkaufsauftrages erstellen]]></title>
<description><![CDATA[
<div class="div_table_100_wo_border">

<div class="div_tablerow">

<div class="div_tablecolumn" style="padding-right:10px">

<p>Das nachstehende Code-Beispiel zeigt. wie man per Code eine Kommissionierliste f&uuml;r alle Positionen eines Verkaufsauftrages erstellen kann.
</p>

</div>


<div class="div_tablecolumn" style="width:40%">

<p><a href="http://www.schweda.net/pictures/blogpics/ax2012_salespickinglist_create.png" rel="lightbox" target="_self"><img alt="Screenshot" height="166" src="http://www.schweda.net/pictures/blogpics/ax2012_salespickinglist_create.png" title="Screenshot" width="396" /></a>
</p>

</div>

</div>

</div>


<pre class="pre_blog_axcode">
static void createSalesPickingList(Args _args)
{
    SalesTable salesTable = SalesTable::find(&quot;000752&quot;);
    SalesFormLetter salesFormLetter;

    salesFormLetter = SalesFormLetter::construct(DocumentStatus::PickingList);
    salesFormLetter.update(salesTable, systemDateGet(), SalesUpdate::All);
}
</pre>


<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Mon, 27 Apr 2020 10:29:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=528</link>
<comments>https://www.schweda.net/blog_ax.php?bid=528</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=528</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=528</wfw:commentRss>
</item>
<item>
<title><![CDATA[Kommissionierliste für einzelne Positionen eines Verkaufauftrages erfassen]]></title>
<description><![CDATA[
<div class="div_table_100_wo_border">

<div class="div_tablerow">

<div class="div_tablecolumn" style="padding-right:10px">

<p>Das nachstehende Code-Beispiel zeigt,&nbsp;wie man per Code eine Kommissionieriste erfassen kann und dabei nur Teilmengen verarbeitet.
</p>


<p>Dabei verfolge ich den Ansatz, f&uuml;r die ben&ouml;tigte Menge eine eigene Zeile in der Tabelle WMSOrderTrans zu erstellen (&uuml;ber die Teilen-Funktion) und die aktuell nicht ben&ouml;tigte Menge zu stornieren.
</p>

</div>


<div class="div_tablecolumn" style="width:40%">

<p><a href="http://www.schweda.net/pictures/blogpics/ax2012_salespickinglist_register.png" rel="lightbox" target="_self"><img alt="Screenshot" height="166" src="http://www.schweda.net/pictures/blogpics/ax2012_salespickinglist_register.png" title="Screenshot" width="396" /></a>
</p>

</div>

</div>

</div>


<pre class="pre_blog_axcode">
static void pickingListRegistrationPartly(Args _args)
{
    WMSPickingRouteID pickingRouteID = &quot;00066&quot;;    // Route id to be picked
    Map inventTransMap = new Map(Types::String, Types::Real);
    MapEnumerator me;
    InventTransId inventTransId;
    Qty pickQty;
    List list = new List(Types::String);
    WmsOrderTrans wmsOrderTrans;
    WmsOrderTrans wmsOrderTransNew;

    list.addEnd(pickingRouteID);

    // Build map containing the lot-ids and quantity to pick
    inventTransMap.insert(&quot;014023&quot;, 7);
    inventTransMap.insert(&quot;014026&quot;, 3);
    
    // Change quantity
    me = inventTransMap.getEnumerator();
    while (me.moveNext())
    {
        inventTransId = me.currentKey();    
        pickQty = me.currentValue();
        
        ttsBegin;
        select forupdate wmsOrderTrans
            where wmsOrderTrans.RouteId == pickingRouteID &amp;&amp;
                  wmsOrderTrans.inventTransId == inventTransId &amp;&amp;
                  wmsOrderTrans.FullPallet == NoYes::No &amp;&amp;
                 (wmsOrderTrans.ExpeditionStatus == WMSExpeditionStatus::Registered ||
                  wmsOrderTrans.ExpeditionStatus == WMSExpeditionStatus::Activated  ||
                  wmsOrderTrans.ExpeditionStatus == WMSExpeditionStatus::Started);        
        
        // Split line
        wmsOrderTransNew = wmsOrderTrans.split(pickQty);        
        ttsCommit;
        
        ttsBegin;
        // Cancel remaining line
        wmsOrderTrans.cancel();
        ttsCommit;
    }
    
    // Update
    WMSPickingRoute::finishMulti(list.pack()); 

    wmsDeliverPickedItems::checkDeliverPickedItems(pickingRouteID, list.pack());
}
</pre>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sun, 15 Mar 2020 18:02:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=649</link>
<comments>https://www.schweda.net/blog_ax.php?bid=649</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=649</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=649</wfw:commentRss>
</item>
<item>
<title><![CDATA[Kontextmenü des X++-Editors in Dynamics AX 2012 erweitern]]></title>
<description><![CDATA[
<div class="div_table_100_wo_border">

<div class="div_tablerow">

<div class="div_tablecolumn" style="padding-right:10px">

<p>Voreinigen Jahren hatte ich schon mal einen <a href="https://www.schweda.net/blog_ax.php?bid=234" target="_self" title="Dynamics AX: Editorscript: Open Object in AOT">Beitrag</a> &uuml;ber die Klasse <strong>EditorScripts </strong>geschrieben. Das ist n&auml;mlich jene, mit deren Hilfe man die Funktionalit&auml;t des X++-Editors recht einfach erweitern kann.
</p>


<p>Beispielsweise kann man das Kontextmen&uuml; des Editors einfach erweitern, in dem man in der Klasse Methoden erstellt.
</p>


<p>Diese Methoden m&uuml;ssen lediglich einige Kriterien erf&uuml;llen, das sind u.a.:
</p>


<ul>
	
<li>Der erste und einzige Parameter muss vom Typ Editor sein
</li>
	
<li>Die Methode muss public sein
</li>
	
<li>Die Methode darf nichts retournieren (void)
</li>

</ul>

</div>


<div class="div_tablecolumn" style="width:30%">

<p><a href="https://www.schweda.net/pictures/blogpics/ax2012_editorscripts_kontext.png" rel="lightbox" target="_blank"><img alt="X++-Editor" height="474" src="https://www.schweda.net/pictures/blogpics/ax2012_editorscripts_kontext.png" style="border-style:solid; border-width:0px" title="X++-Editor" width="770" /></a>
</p>

</div>

</div>

</div>

<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=667" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 07 Feb 2020 07:40:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=667</link>
<comments>https://www.schweda.net/blog_ax.php?bid=667</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=667</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=667</wfw:commentRss>
</item>
<item>
<title><![CDATA[Abfragen von Informationen zu SSRS-Berichten über die Microsoft Dynamics AX 2012 Management Shell]]></title>
<description><![CDATA[
<p><img alt="Microsoft Dynamics AX 2012 Management Shell" height="59" src="http://www.schweda.net/pictures/blogpics/ax2012_managementshell.png" style="float:right; padding-bottom:10px; padding-left:10px" width="258" />Mit der Microsoft Dynamics AX 2012 Management Shell kann man zahlreiche Informationen &uuml;ber seine Dynamics AX 2012-Instanz in Erfahrung bringen.
</p>


<p>Beispielsweise kann man sich &uuml;ber das nachstehende Kommando eine Liste aller SSRS-Berichte oder auch nur einem bestimmten Bericht (z.B. SalesInvoice) ausgeben lassen.
</p>


<pre class="pre_blog_axcode">
get-AXReport -reportname *
get-AXReport -reportname salesinvoice
</pre>

<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=646" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Thu, 05 Dec 2019 15:48:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=646</link>
<comments>https://www.schweda.net/blog_ax.php?bid=646</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=646</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=646</wfw:commentRss>
</item>
<item>
<title><![CDATA[Aufträge an Lagerort freigeben]]></title>
<description><![CDATA[
<div class="div_table_100_wo_border">

<div class="div_tablerow">

<div class="div_tablecolumn" style="padding-right:10px">Um f&uuml;r einen oder mehrere Auftr&auml;ge per Code die Funktion &quot;F&uuml;r Lagerort freigeben&quot; aufzurufen, kann man sich des folgende Codes bedienen.
</div>


<div class="div_tablecolumn" style="width:30%"><a href="http://www.schweda.net/pictures/blogpics/ax2012_release2warehouse4salesorders.png" rel="lightbox" target="_self"><img alt="Screenshot" height="147" src="http://www.schweda.net/pictures/blogpics/ax2012_release2warehouse4salesorders.png" title="Screenshot" width="294" /></a>
</div>

</div>

</div>


<pre class="pre_blog_axcode">
static void releaseToWareHouse(Args _args)
{
    SalesTable salesTale = SalesTable::find(&#39;002162&#39;);
    CustCreditMaxCheck creditMaxCheck;
    List listSalesTable = new List(Types::Record);
    container packedData;
    
    // Release to warehouse
    creditMaxCheck = WHSParameters::getCreditMaxCheck();
    listSalesTable.addEnd(salesTale);

    // Must use value of enum when going through IL
    packedData = [enum2int(creditMaxCheck), listSalesTable.pack()];

    WHSWarehouseRelease::salesFormReleaseCallCIL(packedData);
}
</pre>


<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Thu, 24 Oct 2019 08:19:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=658</link>
<comments>https://www.schweda.net/blog_ax.php?bid=658</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=658</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=658</wfw:commentRss>
</item>
<item>
<title><![CDATA[Eintrag "RPC exception 1702 occurred" im Eventlog]]></title>
<description><![CDATA[
<blockquote>

<p>Object Server 01: &nbsp;RPC error: RPC exception 1702 occurred in session 4 process is Ax32Serv.exe thread is 8788(User: admin, ClientType: Worker)
</p>

</blockquote>


<p>Dieser Eintrag kann auf die Verwendung von client-seitigem Code am Server hindeuten, beispielsweise den Aufruf einer WinApi-Funktion aus einem Stapeljob heraus.
</p>


<p>Sie kann aber auch durch den Aufruf von info(), Warning() oder error() innerhalb eines Stapeljobs ausgel&ouml;st werden, wenn am jeweiligen AOS die Option &quot;Enable global breakpoint&quot; aktiviert ist.
</p>


<p><a href="https://www.schweda.net/pictures/blogpics/ax2012_eventlog_rpc_1702.png" rel="lightbox" target="_blank"><img alt="Screenshot AX 2012 Server Configuration Utility" height="394" src="https://www.schweda.net/pictures/blogpics/ax2012_eventlog_rpc_1702.png" style="border-style:solid; border-width:0px" title="Screenshot AX 2012 Server Configuration Utility" width="841" /></a>
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Tue, 15 Oct 2019 15:37:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=668</link>
<comments>https://www.schweda.net/blog_ax.php?bid=668</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=668</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=668</wfw:commentRss>
</item>
<item>
<title><![CDATA[SQL-Fehler beim Synchronisieren nach Update von AX 2012 auf CU13]]></title>
<description><![CDATA[
<p>W&auml;hrend des Upgrades einer AX 2012 R3 CU9-Instanz auf CU13 (February Release) hatte ich beim Punkt Datenbank synchronisieren der Upgrade-Checklist folgenden Fehler:
</p>


<blockquote>

<p>SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name &#39;dbo.LEDGERPERIODMODULEACCESSCONTROL&#39; and the index name &#39;I_7375LEDGERFISCALCALENDARPERIODIDX&#39;. The duplicate key value is (5637144576, 22565421332).
</p>


<p>SQL statement: CREATE UNIQUE &nbsp;INDEX I_7375LEDGERFISCALCALENDARPERIODIDX ON &quot;DBO&quot;.LEDGERPERIODMODULEACCESSCONTROL (PARTITION,LEDGERFISCALCALENDARPERIOD)
</p>

</blockquote>


<p>Die L&ouml;sung ist, diesen fehler f&uuml;rs erste so zu belassen und mit dem n&auml;chsten Schritt der Checklist, dem Data upgrade zu starten. Einer der auszuf&uuml;hrenden Jobs bereinigt n&auml;mlich jene Datens&auml;tze, die zu dem genannten Fehler f&uuml;hren.
</p>


<p>Nach dem Datenupgrade kann man nun die Datenbank fehlerfrei synchronisieren.
</p>


<p><a href="https://www.schweda.net/pictures/blogpics/ax2012_softwareupdatechecklist_sync.png" rel="lightbox" target="_blank"><img alt="Screenshot" height="673" src="https://www.schweda.net/pictures/blogpics/ax2012_softwareupdatechecklist_sync.png" style="border-style:solid; border-width:0px" title="Screenshot" width="403" /></a><br />
&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sun, 13 Oct 2019 18:09:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=669</link>
<comments>https://www.schweda.net/blog_ax.php?bid=669</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=669</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=669</wfw:commentRss>
</item>
<item>
<title><![CDATA[SysOperation-Framework: ExecutionMode und auszuführende Servermethode über das MenuItem steuern]]></title>
<description><![CDATA[
<p>Wenn man in einem SysOperation-Konstrukt den <strong>SysOperationExecutionMode </strong>und/oder die auszuf&uuml;hrende Servermethode &uuml;ber das MenuItem steuern m&ouml;chte, kann man dies &uuml;ber die Eigenschaften des MenuItems steuern.
</p>


<h2>Szenario: Ohne eigenen Controller
</h2>


<p>Die folgenden beiden MenuItems zeigen, wie man daf&uuml;r die Eigenschaften setzen kann:
</p>


<p>Dieses MenuItem ruft die Methode <em>runService()</em> einer Serviceklasse auf und setzt den <em>SysOperationExecutionMode </em>auf <em>Synchronous</em>:
</p>


<p><a href="http://www.schweda.net/pictures/blogpics/ax2012_sysoperation_tutmenuitem_ctrlsync.png" rel="lightbox" target="_self"><img alt="Screenshot" height="230" src="http://www.schweda.net/pictures/blogpics/ax2012_sysoperation_tutmenuitem_ctrlsync.png" title="Screenshot" width="482" /></a>
</p>

<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=657" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Tue, 24 Sep 2019 17:16:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=657</link>
<comments>https://www.schweda.net/blog_ax.php?bid=657</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=657</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=657</wfw:commentRss>
</item>
<item>
<title><![CDATA[SysOperation-Framework: Stapelverarbeitung erzwingen]]></title>
<description><![CDATA[
<p>Wenn man sicherstellen m&ouml;chte, da&szlig; eine Funktion&nbsp;die &uuml;ber das <strong>SysOperation-Framework</strong> umgesetzt wurde, immer &uuml;ber die <strong>Stapelverarbeitung </strong>ausgef&uuml;hrt wird, kann man den <em>SysOperationExecutionMode </em>auf <em>ScheduledBatch </em>setzen (beispielsweise &uuml;ber das MenuItem des Controllers - siehe <a href="http://www.schweda.net/blog_ax.php?bid=657" target="_self" title="SysOperation-Framework: ExecutionMode und auszuführende Servermethode über das MenuItem steuern">hier</a>).
</p>


<p>Handelt es sich dabei um eine Funktion, die einen Benutzerdialog erfordert, hat man allerdings das Problem, da&szlig; standardm&auml;ssig der Register &quot;Stapel&quot; eingeblendet wird und dort aber beispielsweise das Kontrollk&auml;stchen Stapel nicht aktiviert ist.&nbsp;
</p>


<p>Nat&uuml;rlich kann man dieses Kontrollk&auml;stchen nun aktivieren, in dem man einen Aufruf von <em>parmBatchExecute()</em> im UIBuilder integriert:
</p>


<pre class="pre_blog_axcode">
public void build()
{
    super();

    this.controller().batchInfo().parmBatchExecute(this.controller().parmExecutionMode() == SysOperationExecutionMode::ScheduledBatch);
}
</pre>

<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=656" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 13 Sep 2019 14:29:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=656</link>
<comments>https://www.schweda.net/blog_ax.php?bid=656</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=656</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=656</wfw:commentRss>
</item>
<item>
<title><![CDATA[Erstellen und Buchen einer Freitextrechnung per Code]]></title>
<description><![CDATA[
<p>Der nachstehende Job soll zeigen, wie man per Code eine Freitextrechnung erstellen und buchen kann.
</p>


<pre class="pre_blog_axcode">
static void createAndPostFreeTextInvoice(Args _args)
{
    CustInvoiceTable custInvoiceTable;
    CustInvoiceLine custInvoiceLine;
    DimensionDefault dimensionDefault; 
    LedgerDimensionAccount ledgerDimensionAccount;     
    CustPostInvoice custPostInvoice;
    
    try
    {
        ttsBegin;        
        
        // Create header
        custInvoiceTable.clear();
        custInvoiceTable.initValue();
        custInvoiceTable.OrderAccount = &quot;US-004&quot;;
        custInvoiceTable.modifiedField(
            fieldNum(CustInvoiceTable, OrderAccount));
        custInvoiceTable.insert();
        
        // Create line
        custInvoiceLine.clear();
        custInvoiceLine.initValue();
        custInvoiceLine.ParentRecId = custInvoiceTable.RecId;
        custInvoiceLine.initFromCustInvoiceTable(custInvoiceTable);
        custInvoiceLine.Description = &quot;Test&quot;;
        custInvoiceLine.Quantity = 10;
        custInvoiceLine.modifiedField(
            fieldNum(CustInvoiceLine, Quantity));
        custInvoiceLine.UnitPrice = 200;
        custInvoiceLine.modifiedField(
            fieldNum(CustInvoiceLine, UnitPrice));
        
        ledgerDimensionAccount = 
        DimensionDefaultingService::serviceCreateLedgerDimension(
            DimensionStorage::getDefaultAccountForMainAccountNum(
                &quot;110110&quot;), 
                dimensionDefault); 
        
        custInvoiceLine.LedgerDimension = ledgerDimensionAccount;
        custInvoiceLine.modifiedField(
            fieldNum(CustInvoiceLine, LedgerDimension));
        custInvoiceLine.insert();
        
        // Post
        custPostInvoice = new CustPostInvoice(custInvoiceTable);
        custPostInvoice.run();
        
        ttsCommit;
    }
    catch
    {
        throw error(error::wrongUseOfFunction(funcName()));
    }
}
</pre>


<p>So sieht eine wie oben erstellte Freitextrechnung aus:
</p>


<p><a href="http://www.schweda.net/pictures/blogpics/ax2012_freetextinvoice.png" rel="lightbox"><img alt="Screenshot Freetext invoice" height="633" src="http://www.schweda.net/pictures/blogpics/ax2012_freetextinvoice.png" title="Screenshot" width="1024" /></a>
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sat, 07 Sep 2019 19:27:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=644</link>
<comments>https://www.schweda.net/blog_ax.php?bid=644</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=644</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=644</wfw:commentRss>
</item>
<item>
<title><![CDATA[Debuggen von SSRS-Dataprovider die von SrsReportDataProviderPreProcess abgeleitet sind]]></title>
<description><![CDATA[
<p>In <a href="http://www.schweda.net/blog_ax.php?bid=591" target="_self" title="Debuggen von SSRS-Dataprovider">diesem Beitrag</a> habe ich schon einmal beschrieben, wie man einen DataProvider &quot;debuggen&quot; kann, der von SRSReportDataProviderBase abgeleitet ist.&nbsp;
</p>


<p>Der folgende Job macht prinzipiell das gleiche, allerdings f&uuml;r vorverarbeitete Reports, also welche wo der DataProvider von&nbsp;<strong>SrsReportDataProviderPreProcess </strong>abgeleitet ist. Im Beispiel verwende ich den DataProvider einer Ausgangsrechnung (SalesInvoice).
</p>


<pre class="pre_blog_axcode">
static void testSSRSDataProvider_SalesInvoice(Args _args)
{
    SalesInvoiceTmp salesInvoiceTmp;
    SalesInvoiceDP dataProvider = new SalesInvoiceDP();
    SalesInvoiceContract contract;
    CustInvoiceJour CustInvoiceJour = CustInvoiceJour::findRecId(35637191172);
    UserConnection UserConnection;

    try
    {
        ttsBegin;

        UserConnection = new UserConnection();

        contract = new SalesInvoiceContract();
        contract.parmFormLetterRecordId(CustInvoiceJour.RecId);
        contract.parmRecordId(CustInvoiceJour.RecId);

        dataProvider = new SalesInvoiceDP();
        dataProvider.parmDataContract(contract);
        dataProvider.parmUserConnection(UserConnection);
        dataProvider.processReport();

        salesInvoiceTmp = dataProvider.getSalesInvoiceTmp();
        
        while select salesInvoiceTmp
            where SalesInvoiceTmp.createdTransactionId == appl.curTransactionId()
        {
            info(strFmt(&quot;%1 %2&quot;, SalesInvoiceTmp.InvoiceId, SalesInvoiceTmp.ItemId));
        }

        ttsCommit;
    }
    catch (Exception::Break)
    {
        info(&quot;Aborted&quot;);
    }
}
</pre>


<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Mon, 10 Jun 2019 19:51:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=652</link>
<comments>https://www.schweda.net/blog_ax.php?bid=652</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=652</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=652</wfw:commentRss>
</item>
<item>
<title><![CDATA[Entnahme einer reservierten Auftragsposition per Code]]></title>
<description><![CDATA[
<p>Um die bereits reservierten Mengen einer Auftragspositionen per Code zu entnehmen, kann man Code wie den folgenden verwenden:
</p>


<pre class="pre_blog_axcode">
static void JobPick(Args _args)
{
    Query inventTransQuery;
    QueryRun qr;
    QueryBuildDataSource qbds;
    InventTrans inventTrans;
    InventDim inventDim;
    InventTransOrigin inventTransOrigin;
    TmpInventTransWMS tmpInventTransWMS;
    InventTransWMS_Pick inventTransWMS_Pick;
    SalesLine salesLine = SalesLine::findInventTransId(&#39;014417&#39;);
    
    inventTransQuery = new Query();
    qbds = inventTransQuery.addDataSource(tableNum(InventTrans));
    qbds.addRange(fieldNum(InventTrans, StatusIssue)).value(queryValue(StatusIssue::ReservPhysical));
    qbds = qbds.addDataSource(tableNum(InventTransOrigin));
    qbds.relations(true);
    qbds.joinMode(JoinMode::InnerJoin);
    qbds.addRange(fieldNum(InventTransOrigin, InventTransId)).value(salesLine.InventTransId);
    
    qr = new QueryRun(inventTransQuery);
    while (qr.next())
    {
        inventTrans = qr.get(tableNum(InventTrans));
        inventTransOrigin = qr.get(tableNum(InventTransOrigin));
        
        // Set inventory dimensions for picking
        inventDim = inventDim::find(inventTrans.InventDimId);
        inventDim.wmslocationId = &quot;06A01R3S1B&quot;;   
        inventDim.LicensePlateId = &quot;LP_61_A0001&quot;;
        inventDim = inventDim::findOrCreate(inventDim);
        
        tmpInventTransWMS.clear();
        
        inventTransWMS_Pick = InventTransWMS_Pick::newStandard(tmpInventTransWMS, inventTransQuery);
        
        tmpInventTransWMS.initFromInventTrans(InventTrans);
        tmpInventTransWMS.initFromInventTransOrigin(inventTransOrigin);
        tmpInventTransWMS.initFromInventDim(inventDim);
        
        tmpInventTransWMS.InventQty = -inventTrans.Qty;
        
        inventTransWMS_Pick.writeTmpInventTransWMS(tmpInventTransWMS);
        inventTransWMS_Pick.updateInvent();    
    }
}
</pre>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 26 Apr 2019 19:50:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=659</link>
<comments>https://www.schweda.net/blog_ax.php?bid=659</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=659</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=659</wfw:commentRss>
</item>
<item>
<title><![CDATA[Impact Analysis Tool scheitert beim Löschen der Baseline-Datenbank]]></title>
<description><![CDATA[
<p>K&uuml;rzlich hatte ich beim Ausf&uuml;hren des Impact Analysis Tools das Problem, da&szlig; der Installer scheinbar beim L&ouml;schen der Baseline-Datenbank ein Problem hatte und an dieser Stelle stoppte/h&auml;ngen blieb. Eintrag im Eventlog war &uuml;brigens keiner vorhanden.
</p>


<p><a href="http://www.schweda.net/pictures/blogpics/ax2012_impactanalysis_baselinedelete.png" rel="lightbox" target="_self"><img alt="Screenshot Impact Analysis Tool" height="585" src="http://www.schweda.net/pictures/blogpics/ax2012_impactanalysis_baselinedelete.png" title="Screenshot Impact Analysis Tool" width="1055" /></a>
</p>


<p>Interessanterweise konnte ich auch die Eigenschaften der Baseline-Datenbank &uuml;ber das SQL Server Management Studio nicht einsehen, dabei trat folgender Fehler auf:
</p>


<blockquote>

<p>Property Size is not available for Database &#39;[AX2012R3_Baseline]&#39;. This property may not exist for this object, or may not be retrievable due to insufficient access rights. &nbsp;(Microsoft.SqlServer.Smo)
</p>

</blockquote>


<p>Ich habe also vermutet, da&szlig; die Datenbank in irgendeiner Art &amp; Weise defekt ist. Deshalb habe ich einfach versucht, &uuml;ber AXUTIL die Baseline-Datenbank zu re-initalisieren, was meinen Fehler schlie&szlig;lich auch behoben hat:
</p>


<pre class="pre_blog_sqlcode">
axutil schema /DB:AX2012R3_Baseline /S:MyServerName
</pre>


<p>Nach dem Initialisieren der Datenbank konnte ich das Impact Analysis Tool problemlos starten.
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Mon, 22 Apr 2019 16:56:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=663</link>
<comments>https://www.schweda.net/blog_ax.php?bid=663</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=663</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=663</wfw:commentRss>
</item>
<item>
<title><![CDATA[SysOperation-Framework: Eigene Nutzungsdaten pro MenuItem]]></title>
<description><![CDATA[
<p>Stellt euch vor, ihr habt eine &uuml;ber das SysOperation-Framework abgebildete Funktion die an unterschiedlichen Stellen &uuml;ber im System aufgerufen werden kann, und ihr wollt sicherstellen, da&szlig; sich diese Aufrufe nicht die gleichen Nutzungsdaten teilen.
</p>


<p>In einem solchen Fall k&ouml;nnte man zwei (oder mehrere) MenuItems erstellen und die Methode <em>lastValueDesignName()</em> des Controllers wie folgt &uuml;bersteuern. Dadurch werden je MenuItem eigene Nutzungdaten abgelegt.
</p>


<pre class="pre_blog_axcode">
protected IdentifierName lastValueDesignName()
{
    IdentifierName ret;

    ret = super();

    if (this.parmArgs() &amp;&amp; this.parmArgs().menuItemName())
    {
        ret = this.parmArgs().menuItemName();   
    }

    return ret;
}
</pre>

<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=660" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Wed, 10 Apr 2019 17:27:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=660</link>
<comments>https://www.schweda.net/blog_ax.php?bid=660</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=660</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=660</wfw:commentRss>
</item>
<item>
<title><![CDATA[Query/QueryRun auf eine temporäre Tabelle]]></title>
<description><![CDATA[
<p>Wenn man den Inhalt einer tempor&auml;ren Tabelle mit einem QueryRun durchlaufen will, muss man - anders als bei einer&nbsp;nicht tempor&auml;ren Tabelle - zuvor die Methode <em>setRecord()</em> des QueryRun-Objektes verwenden.
</p>


<h2>Einfaches Beispiel
</h2>


<pre class="pre_blog_axcode">
static void Job1(Args _args)
{
    TmpFrmVirtual tmpFrmVirtual;
    InventTable inventTable;
    Query q;
    QueryRun qr;
    QueryBuildDataSource qbds1, qbds2;
    
    TmpFrmVirtual populateTmpFrmVirtual()
    {
        TmpFrmVirtual tmpFrmVirtualLocal;    
        
        tmpFrmVirtualLocal.clear();
        tmpFrmVirtualLocal.ItemId = &quot;A0001&quot;;
        tmpFrmVirtualLocal.insert();
        
        tmpFrmVirtualLocal.clear();
        tmpFrmVirtualLocal.ItemId = &quot;A0002&quot;;
        tmpFrmVirtualLocal.insert();        
        
        tmpFrmVirtualLocal.clear();
        tmpFrmVirtualLocal.ItemId = &quot;A0003&quot;;
        tmpFrmVirtualLocal.insert();          
        
        return tmpFrmVirtualLocal;
    }
    
    q = new Query();
    qbds1 = q.addDataSource(tableNum(TmpFrmVirtual));
    
    qr = new QueryRun(q);
    qr.setRecord(populateTmpFrmVirtual());
    while (qr.next())
    {
        tmpFrmVirtual = qr.get(tableNum(tmpFrmVirtual));    
        
        info(tmpFrmVirtual.ItemId);
    }  
}
</pre>

<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=662" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sun, 24 Mar 2019 18:33:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=662</link>
<comments>https://www.schweda.net/blog_ax.php?bid=662</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=662</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=662</wfw:commentRss>
</item>
<item>
<title><![CDATA[Filter über Finanzdimensionen in einer FormDataSource]]></title>
<description><![CDATA[
<p>M&ouml;chte man in einem Formular nur Datens&auml;tze einer Tabelle anzeigen, die bestimmte Finanzdimensionen enthalten, kann man dies &uuml;ber das &uuml;berschreiben der <em>init()</em> der FormDataSource wie folgt erreichen:
</p>


<pre class="pre_blog_axcode">
public void init()
{
    super();
    
    SysQuery::addDimensionAttributeRange(salesTable_ds.query(),
                        salesTable_ds.name(),
                        fieldStr(Salestable, DefaultDimension),
                        DimensionComponent::DimensionAttribute,
                        &#39;1001&#39;,
                        &#39;CostCenter&#39;);    
}
</pre>


<p>Man kann <em>addDimensionAttributeRange()</em> auch mehrmals aufrufen, so kann man nach mehreren Dimensionen gleichzeitig filtern.
</p>


<p>Mit <em>clearDimensionRangesFromQuery()</em> entfernt man solche Filter &uuml;brigens wieder:
</p>


<pre class="pre_blog_axcode">
SysQuery::clearDimensionRangesFromQuery(salesTable_ds.query())
</pre>


<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 08 Mar 2019 18:18:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=661</link>
<comments>https://www.schweda.net/blog_ax.php?bid=661</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=661</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=661</wfw:commentRss>
</item>
<item>
<title><![CDATA[Stapelverarbeitungsauftrag mit mehreren Aufgaben per Code erstellen]]></title>
<description><![CDATA[
<p>Die nachstehenden Code-Snippets sollen zeigen, wir man mit Hilfe der BatchHeader-Klasse Stapelverarbeitungsauftr&auml;ge erstellen kann.
</p>


<h2>Beispiele f&uuml;r ein&nbsp;RunBaseBatch-Konstrukt
</h2>


<pre class="pre_blog_axcode">
static void createBatchWithMultipletasks(Args _args)
{
    BatchHeader batchHeader;
    Tutorial_RunbaseBatch batchTask1, batchTask2, batchTask3;

    //create batch header
    batchHeader = BatchHeader::construct();
    batchHeader.parmCaption(&quot;Example of a batch job with multiple tasks&quot;);

    //create instances of the classes to use as batch tasks
    batchTask1 = Tutorial_RunbaseBatch::construct();
    batchTask2 = Tutorial_RunbaseBatch::construct();
    batchTask3 = Tutorial_RunbaseBatch::construct();

    //add the batch tasks to the batch header
    batchHeader.addTask(batchTask1);
    batchHeader.addTask(batchTask2);
    batchHeader.addTask(batchTask3);

    //save the batch
    batchHeader.save();
}
</pre>

<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=654" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Wed, 13 Feb 2019 19:25:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=654</link>
<comments>https://www.schweda.net/blog_ax.php?bid=654</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=654</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=654</wfw:commentRss>
</item>
<item>
<title><![CDATA[Ausgangsrechnung per Code buchen und dabei nur bestimmte Positionen wählen und ggf. die Menge anpassen]]></title>
<description><![CDATA[
<p>Mit Hilfe des folgenden Code ist es m&ouml;glich eine Verkaufsrechnung f&uuml;r einen bestimmten Auftrag zu buchen und dabei nur ausgew&auml;hlte Auftragspositionen zu verarbeiten.<br />
Der Trick dabei ist, sich &uuml;ber die Standardfunktionalit&auml;t &uuml;ber die Methode<em> initLinesQuery()</em> die Tabelle <em>SalesParmLine </em>aufbauen zu lassen und vor dem eigentlichen Buchungsvorgang diese Datens&auml;tze zu modifizieren.&nbsp;Beispielsweise indem man ganze Datens&auml;tze aus der <em>SalesParmLine </em>l&ouml;scht.
</p>


<pre class="pre_blog_axcode">
static void createSalesInvoiceSelectLines(Args _args)
{
    SalesTable salesTable = SalesTable::find(&#39;001562&#39;);
    SalesFormLetter salesFormLetter;
    SalesParmLine salesParmLine;
    
    setPrefix(funcName());
    
    salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice);

    // Do the steps manually, which normally are done in method salesFormLetter.update()
    salesFormLetter.salesTable(salesTable);
    salesFormLetter.initParmSalesTable(salesFormLetter.salesTable());
    salesFormLetter.transDate(systemDateGet());
    salesFormLetter.specQty(SalesUpdate::All);
    salesFormLetter.proforma(salesFormLetter.salesParmUpdate().Proforma);
    salesFormLetter.printFormLetter(salesFormLetter.printFormLetter());
    salesFormLetter.printCODLabel(NoYes::No);
    salesFormLetter.printShippingLabel(NoYes::No);
    salesFormLetter.usePrintManagement(false);
    salesFormLetter.creditRemaining(salesFormLetter.creditRemaining());

    salesFormLetter.createParmUpdateFromParmUpdateRecord(
        SalesFormletterParmData::initSalesParmUpdateFormletter(
            salesFormLetter.documentStatus(),                   
            salesFormLetter.pack(),                                                                                                                
            true,                                                                                                                
            false,                                                                                                                
            false));

    salesFormLetter.initParameters(salesFormLetter.salesParmUpdate(), Printout::Current);

    salesFormLetter.initLinesQuery();
    
    while select forupdate salesParmLine
        where salesParmLine.ParmId == salesFormLetter.parmId()
    {
        setPrefix(#PrefixField(salesParmLine, InventTransId));
        
        // ...Modify record/Delete record...
    }

    // Let&#39;s go
    if (salesFormLetter.validate(null))
    {
        salesFormLetter.run();
    }
}
</pre>


<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sun, 03 Feb 2019 18:18:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=655</link>
<comments>https://www.schweda.net/blog_ax.php?bid=655</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=655</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=655</wfw:commentRss>
</item>
<item>
<title><![CDATA[SysOperation-Framework: Einfachstes Klassenkonstrukt]]></title>
<description><![CDATA[
<p>Der nachstehende Code stellt die einfachste M&ouml;glichkeit dar, wie man eine Funktion &uuml;ber das SysOperation-Framework umsetzt. Ganz ohne DataController, Dataprovider und UIBuilder. Nur &uuml;ber eine Service-Klasse und ein MenuItem.
</p>


<h2>Service
</h2>


<pre class="pre_blog_axcode">
class TutorialSysOperationSimpleService extends SysOperationServiceBase
{
}
</pre>


<p>Die Methode&nbsp;<em>runService()</em>&nbsp;ist die eigentliche Service-Methode. &Uuml;ber das Attribute&nbsp;<em>SysEntryPointAttribute&nbsp;</em>steuern wir hier, da&szlig; keine weiteren Berechtigungspr&uuml;fungen notwendig sind.
</p>


<pre class="pre_blog_axcode">
[SysEntryPointAttribute(false)]
public void runService()
{
    info(&quot;Done&quot;);
}
</pre>

<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=653" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Wed, 30 Jan 2019 17:54:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=653</link>
<comments>https://www.schweda.net/blog_ax.php?bid=653</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=653</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=653</wfw:commentRss>
</item>
<item>
<title><![CDATA[SysOperation-Framework: Stapelverarbeitung standardmässig aktivieren]]></title>
<description><![CDATA[
<p>Wer bei einer &uuml;ber das SysOperation-Framework umgesetzten Funktion standardm&auml;ssig die Stapelverarbeitung aktivieren m&ouml;chte, kann dies wie in folgendem Beispiel &uuml;ber einen Eingriff in den UI-Builder umsetzen.
</p>


<pre class="pre_blog_axcode">
public void build()
{
    super();
    
    this.controller().batchInfo().parmBatchExecute(NoYes::Yes);
}
</pre>


<p>Durch den Code wird das Kennzeichen <em>Stapelverarbeitung </em>im Register <em>Stapel </em>aktiviert.
</p>


<p><a href="http://www.schweda.net/pictures/blogpics/ax2012_sysoperation_batchbydefault.png" rel="lightbox" target="_self"><img alt="Screenshot" height="171" src="http://www.schweda.net/pictures/blogpics/ax2012_sysoperation_batchbydefault.png" title="Screenshot" width="675" /></a>
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 04 Jan 2019 20:06:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=651</link>
<comments>https://www.schweda.net/blog_ax.php?bid=651</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=651</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=651</wfw:commentRss>
</item>
<item>
<title><![CDATA[Auslesen des Inhalts einer AXMODEL-Datei]]></title>
<description><![CDATA[
<p><img alt="Microsoft Dynamics AX 2012 Management Shell" height="59" src="http://www.schweda.net/pictures/blogpics/ax2012_managementshell.png" style="float:right; padding-bottom:10px; padding-left:10px" width="258" />Wenn man von Microsoft einen Hotfix oder von einem Microsoft-Partner ein Modul bekommt, bekommt man oft nur ein oder mehrere AXMODEL-Files. Und da ist der Wunsch oft gross, vorab zu wissen, welche Objekte durch das Einspielen dieses Files betroffen ist.
</p>


<p>Solche Informationen kann man sich mit der <strong>Microsoft Dynamics AX 2012 Management Shell</strong> auslesen:
</p>


<pre class="pre_blog_axcode">
Get-AXModel -File &#39;c:&#092;temp&#092;dynamicsax2012r3_cl4555332.axmodel&#39; -Details
</pre>


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

<pre class="pre_blog_axcode">
Manifest                   Summary                    Elements
--------                   -------                    --------
Microsoft.Dynamics.AX.F... {&#092;Classes: 3}              {&#092;Classes&#092;WHSLoadLineI...
</pre>

<br /><a class="div_blog_category_gotodetail" href="https://www.schweda.net/blog_ax.php?bid=647" target="_self" title="Weiterlesen...">Weiterlesen...</a>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 23 Nov 2018 19:53:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=647</link>
<comments>https://www.schweda.net/blog_ax.php?bid=647</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=647</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=647</wfw:commentRss>
</item>
<item>
<title><![CDATA[Kostenstelle per Code anlegen]]></title>
<description><![CDATA[
<p>Wer mal in die Verlegenheit kommt, eine Kostenstelle per Code anlegen zu m&uuml;ssen, dem kann vielleicht dieser Job als Inspiration dienen:
</p>


<pre class="pre_blog_axcode">
static void createCostCenter(Args _args)
{
    str 30 _costCenter = &quot;0815&quot;; // Cost center id to create

    OMOperatingUnit omOperatingUnit;
    NumberSeqFormHandler numberSeqFormHandler;
    NumberSeq numberSeq;

    if (_costCenter)
    {
        if (!OMOperatingUnit::findName(
            _costCenter, OMOperatingUnitType::OMCostCenter))
        {
            ttsbegin;
            numberSeq = NumberSeq::newGetNumFromId(
                OMOperatingUnit::getNumberSequenceReference().NumberSequenceId);

            omOperatingUnit.clear();

            omOperatingUnit.initValue();
            omOperatingUnit.omOperatingUnitNumber = numberSeq.num();
            omOperatingUnit.Name = _costCenter;    // Id used as name
            omOperatingUnit.NameAlias = _costCenter;
            omOperatingUnit.omOperatingUnitType = OMOperatingUnitType::OMCostCenter;
            omOperatingUnit.LanguageId = CompanyInfo::languageId();

            if (omOperatingUnit.validateWrite())
            {
                omOperatingUnit.insert();
            }
            ttscommit;
        }
    }
}
</pre>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Mon, 05 Nov 2018 22:01:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=645</link>
<comments>https://www.schweda.net/blog_ax.php?bid=645</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=645</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=645</wfw:commentRss>
</item>
</channel>
</rss>	
