Confirm a Sales Order through code
Over the next few days I am going to post code that walks through the sales life cycle. To start below is code that will take a given SalesId and confirm it.
public boolean confirmSalesOrder(SalesId _salesId)
{
SalesFormletter SalesFormletter;
SalesTable SalesTable;
;
SalesFormletter =
SalesFormletter::construct(DocumentStatus::Confirmation,true);
SalesTable.clear();
SalesTable = SalesTable::find(_salesId);
SalesFormletter.update(SalesTable,
systemDateGet(),
SalesUpdate::All,
AccountOrder::None,
false,
false);
}
This code is straight forward and simple. It has been very useful to me, because we made a lot of changes to the Sales Life cycle of Axapta. What I did was create a Class that contained different methods for taking sales orders through the sales life cycle. Next is Packing Slip Update (when changed the name of this to Delivered.)
Find a job at: www.DynamicsAXJobs.com
public boolean confirmSalesOrder(SalesId _salesId)
{
SalesFormletter SalesFormletter;
SalesTable SalesTable;
;
SalesFormletter =
SalesFormletter::construct(DocumentStatus::Confirmation,true);
SalesTable.clear();
SalesTable = SalesTable::find(_salesId);
SalesFormletter.update(SalesTable,
systemDateGet(),
SalesUpdate::All,
AccountOrder::None,
false,
false);
}
This code is straight forward and simple. It has been very useful to me, because we made a lot of changes to the Sales Life cycle of Axapta. What I did was create a Class that contained different methods for taking sales orders through the sales life cycle. Next is Packing Slip Update (when changed the name of this to Delivered.)
Find a job at: www.DynamicsAXJobs.com
3 Comments:
this is more short equivalent
public boolean confirmSalesOrder(SalesId _salesId)
{
SalesTable salesTable = SalesTable::find(_salesId);
SalesFormletter salesFormletter = SalesFormletter::construct(DocumentStatus::Confirmation,true);
;
salesFormletter.update(salesTable, systemDateGet(), SalesUpdate::All, AccountOrder::None,
false, false);
}
Formatted, Translated to Russian and placed at http://erpkb.com/Axapta/KakProgramnoPodtverdit'Zakaz
Thank you for posting.
Very helpfull for me. In my job, I needed exactly that implementation methods.
see you later.
Hi All
Is there any way to cancel a Sales Order in code ? I tried DocumentStatus::Cancel and doesnt work.
Thanks
Post a Comment
<< Home