Hi,
I've wrote a simple method in SalesSalesOrderService but it doesn't confirm the status of Salesorder rather it creates a new sales order and duplicates all the values including lines. Following is my code.
[AifDocumentReadAttribute, SysEntryPointAttribute(true)]
public boolean confirmSales(SalesId _salesId)
{
SalesFormletter SalesFormletter;
SalesTable SalesTable;
try
{
SalesFormletter = SalesFormletter::construct(DocumentStatus::Confirmation);
SalesTable = SalesTable::find(_salesId);
SalesFormletter.update(SalesTable,
systemDateGet(),
SalesUpdate::All,
AccountOrder::None,
false,
false);
return true;
}
catch(Exception::Error)
{
return false;
}
}
I've also tried changing AifDocumentReadAttribute to AifDocumentUpdateAttribute but it still creates another order. I've testing the same code via job and it works.
Need your help guys. Thanks.
*This post is locked for comments
I have the same question (0)