Hi,
In this post we will learn the below using X++ :
1) How to Create Sales Order
2) How to Create Sales Order Line
3) How to Post Sales Order
Code :
public static void SalesOrderDemo(Args _s)
{
// Create the Sales Order
SalesTable salesTable;
NumberSeq NumberSeq;
SalesId sid;
SalesLine sl;
SalesFormLetter fl;
;
NumberSeq =NumberSeq::newGetNumFromCode(SalesParameters::numRefSalesId().numberSequence);
sid=NumberSeq.num();
salesTable.SalesId = sid;
salesTable.initValue();
salesTable.CustAccount = "1101";
salesTable.initFromCustTable();
salesTable.insert();
//Create the Sales Line with the created Sales Order
sl.SalesId=sid;
sl.ItemId="1109";
sl.CreateLine(NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes);
info("Sales Order Created with Line");
//How to Post the Sales Order Invoice
fl=SalesFormLetter::construct(DocumentStatus::Invoice);
fl.update(SalesTable::find(sid));
info("Sales Order Posted");
}
Enjoy DAX!!!
In this post we will learn the below using X++ :
1) How to Create Sales Order
2) How to Create Sales Order Line
3) How to Post Sales Order
Code :
public static void SalesOrderDemo(Args _s)
{
// Create the Sales Order
SalesTable salesTable;
NumberSeq NumberSeq;
SalesId sid;
SalesLine sl;
SalesFormLetter fl;
;
NumberSeq =NumberSeq::newGetNumFromCode(SalesParameters::numRefSalesId().numberSequence);
sid=NumberSeq.num();
salesTable.SalesId = sid;
salesTable.initValue();
salesTable.CustAccount = "1101";
salesTable.initFromCustTable();
salesTable.insert();
//Create the Sales Line with the created Sales Order
sl.SalesId=sid;
sl.ItemId="1109";
sl.CreateLine(NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes);
info("Sales Order Created with Line");
//How to Post the Sales Order Invoice
fl=SalesFormLetter::construct(DocumentStatus::Invoice);
fl.update(SalesTable::find(sid));
info("Sales Order Posted");
}
Enjoy DAX!!!
Hi,
ReplyDeleteI need to copy existing sales order + lines to the new sales order and it's line in ax 2012 through x++ code.
How we can do that? Any idea! Please share it.
Regards,
Zahir
A thorough course should cover many topics including: broker price opinions, how to locate these types of properties, how to finance the purchase, how to complete the short sale package, how to estimate the repairs for the property, and possibly how to liquidate the property by finding a buyer quickly. קורס מכירות
ReplyDelete