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();
}

3 comments:

  1. Thank you, this code works and helps a lot. :)

    ReplyDelete
  2. Hi Muhammad,
    Do you have a code, how to create the Request For Quotation through X++ code.


    Thanks in advance.

    ReplyDelete