Tuesday, April 19, 2011

Create a Sales Order in AX 2009 using X++


Following is the Example of Creating a SalesOrder using X++ :

static void createSalesTable(Agrs args)
{
SalesTable salesTable;
NumberSeq NumberSeq;
;
NumberSeq =NumberSeq::newGetNumFromCode(SalesParameters::numRefSalesId().numberSequence);
salesTable.SalesId = NumberSeq.num();
salesTable.initValue();
//you can also pass your account number from query
salesTable.CustAccount = "1101";
salesTable.initFromCustTable();
salesTable.insert();
info("Sales Order has been Created Sucessfully");
}

1 comment:

Thanks for your time reviewing this blog.