Tuesday, April 14, 2015

Sales Order Confirmation through code

Few days earlier i got a  requirement from client to auto confirm a sales order after creating a sales order(importing SO xml) using standard sales order document service. Here is the code for sales order conformation. 

public boolean confirmSalesOrder(SalesId _salesId)
{
     SalesFormletter SalesFormletter;
    SalesTable SalesTable;

    SalesFormletter = SalesFormletter::construct(DocumentStatus::Confirmation,true);

    SalesTable = SalesTable::find(_salesId);

    SalesFormletter.update(SalesTable,
                                              systemDateGet(),
                                              SalesUpdate::All,
                                              AccountOrder::None,
                                              false,
                                              false);

}

I Added this method in AxdSalesOrder class and called it after SO record was created in AX. 
In next few days i am going to share more information on AIF, EP and other AX stuff.  

No comments:

Post a Comment