Interview Questions

Wednesday, March 26, 2014

How to create Sales Order with sales Line by code

static void createSalesOrder(Args _args)
{
    AxSalesLine axSalesLine = new axSalesLine();
    AxSalesTable axsalesTable = new axSalesTable();
    SalesId salesId;
    ;

    salesId = axsalesTable.parmSalesId();///Creates sales Id
    axsalesTable.parmCustAccount('1601');
    axsalesTable.save();

    axSalesLine.parmSalesId(axsalesTable.parmSalesId());//assigns sales Id
    axSalesLine.parmItemId('PolyEthylene');// Item Id
    axSalesLine.axInventDim().parmInventSiteId("Unit1");//Site
    axSalesLine.axInventDim().parmInventLocationId("RM");//Warehouse


    axSalesLine.parmSalesQty(1000);//Quantity
    axSalesline.parmSalesPrice(20);//Sales Price per one quantity
    axSalesLine.save();
}

No comments:

Post a Comment