|
06.11.2012, 21:12 | #1 |
Участник
|
ax-erp: Processing Business Tasks - Posting sales orders
Источник: http://microsoft-dynamics-ax-erp.blo...ing-sales.html
============== Sales order posting is also done in a very similar way to posting a purchase order. The posting function can be executed from code and can be integrated into various customizations.In this recipe, we will use a standard Dynamics AX API to post and print a sales packing slip document from code. As an example, we will post and print a packing slip for the sales order created in the previous recipe. <h4 class="docSection2Title" id="title-ID0ENUAI">How to do it...</h4>
<h4 class="docSection2Title" id="title-ID0EHYAI">How it works...</h4>First, we create a new class named SalesOrderPost with a main() method. The method starts with finding sales order SO-100160, which we created in the previous recipe. Here, we would normally replace this code with user input or an output from another source. Next, we call construct() on the SalesFormLetter class to create a new salesFormLetter instance. The method accepts an argument of type DocumentStatus, which defines the type of posting. Here, we use DocumentStatus::PackingSlip for sales packing slip posting. construct() also accepts a second optional boolean argument, which controls whether a new SalesParmUpdate record, used for sales order posting grouping, should be created. The default is true. And finally, we call update() on salesFormLetter, which does actual posting. It accepts a number of arguments:
salesFormLetter = SalesFormLetter::construct( DocumentStatus::PackingSlip); with: salesFormLetter = SalesFormLetter::construct( DocumentStatus::Invoice); Run the class and notice that now the sales order was invoiced: Open Accounts receivable | Sales Order Details, select the previously specified sales order, click theInquiries button, and choose Invoice to view the results: Источник: http://microsoft-dynamics-ax-erp.blo...ing-sales.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|