Sunday, 5 February 2012

Create Sales Quotation using X++ Code in Ax2012


static void CreateSalesQuotation(Args _args)
{
    AxSalesQuotationTable    AxSalesQttable;
    AxSalesQuotationLine     AxSalesQtline;
    SalesQuotationLine      SalesQuotationLine;
    salesQuotationTable     salesQuotationTable;
    CustTable     custTable;
    SalesQty  salesQty;
    ;
    salesQty = 2;
    AxSalesQttable =  new AxSalesQuotationTable();
    AxSalesQttable.parmCustAccount('C-20');
    AxSalesQttable.parmCurrencyCode('USD');        
    AxSalesQttable.save();
    AxSalesQtline =  new AxSalesQuotationLine();//::construct(smmQuotationLine);

    AxSalesQtline.axSalesQuotationTable(AxSalesQttable);

    AxSalesQtline.parmQuotationId(AxSalesQttable.parmQuotationId());
    AxSalesQtline.axSalesQuotationTable(AxSalesQttable);
    AxSalesQtline.parmItemId('1000');

    AxSalesQtline.parmSalesQty(salesQty);

    AxSalesQtline.parmInventDimId('00001005_069');
    //AxSalesQtline.par

    AxSalesQtline.parmcurrencyCode('USD');
    AxSalesQtline.save();
}