Показать сообщение отдельно
Старый 06.11.2012, 15:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
ax-erp: Posting Invoice from Sales order/ Purchase order.
Источник: http://microsoft-dynamics-ax-erp.blo...les-order.html
==============


One of the most commonly used classes in AX are the FormLetter classes. The
FormLetter classes define how to post different status updates against sales orders
and purchase orders.
The normal flow when a posting is being performed is that the parm tables are
Populated with data, and then the update itself is performed.
Below example will shows how to Post the Invoice from sales order, similar logics can be used to post the Invoice from Purchase order.

static void postSalesInvoice(Args _args)
{
// Define a classvariable according to the
// type of posting being performed
SalesFormLetter_Invoice invoice;
SalesTable salesTable;
;
// Select the salesTable to update
salesTable = SalesTable::find(“SO-101297″);
// Create a new object of the SalesFormLetter_Invoice
// by using the construct-method in SalesFormLetter
invoice = SalesFormLetter::construct(DocumentStatus::Invoice);
// Post the invoice
invoice.update(salesTable,
SystemDateGet(),
SalesUpdate::All,
AccountOrder::None,
false,
true); // Set to true to print the invoice
}

The next screenshot shows the class hierarchy of FormLetter with all its subclasses: we can easily custamize the above logic to post different status updates against sales orders
and purchase orders

Sales (Confirmation, Picking list, Packing slip, Invoice )
Purch (Purchase order,Receipt list, Packing slip, Invoice)





Источник: http://microsoft-dynamics-ax-erp.blo...les-order.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.