<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="https://www.schweda.net/style_feed.css" ?>
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:atom="http://www.w3.org/2005/Atom"	
	xmlns:dc="http://purl.org/dc/elements/1.1/" > 
<channel>
    <title>schweda.net - Blog</title>
    <link>https://www.schweda.net/</link>
    <description>schweda.net - Blog - Blog-Beitraege</description>
    <language>de-at</language>
    <copyright>Copyright 2006-2026</copyright>
    <generator>schweda.net</generator>
    <managingEditor>heinz.schweda@schweda.net (Heinz Schweda)</managingEditor>
    <webMaster>heinz.schweda@schweda.net (Heinz Schweda)</webMaster>
    <category>Blog</category>
	<atom:link href="https://schweda.net/blog_rss.php?bid=655" rel="self" type="application/rss+xml" />
<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>Kommentar von Emir</title>
<description><![CDATA[Wenn ich diesen Code so ausführe und dabei die DeliverNow quantity änder wird sie beim buchen zurück geändert auf die ursprüngliche mänge warum ist das so?]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Thu, 17 Nov 2022 10:03:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=655</link>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=655</guid>
<author>Emir</author>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Heinz Schweda</dc:creator>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=655</wfw:commentRss>
</item>
</channel>
</rss>	
