Hi, I've written the following JOB in Axapta to post invoice for SalesID
in this example '00046_036', you can change that anyway. However it
doesn't seem to be posting and changing the document status to Invoiced.
Can someone please take a quick look at it and see what I am doing wrong
here?







static void PostInvoice(Args _args)

{



     SalesFormLetter slsLetter;

     SalesFormLetter mySalesFormLetter;

     SalesTable              slsTable;

     CustTable          custTable;

     TransDate          transDate;

     salesUpdate          slsUpdate;

     NoYes           _proforma;

     NoYes           _print;

;

    _proforma = NoYes::No;

    _Print = NoYes::No;

    slsLetter = SalesFormLetter::construct(DocumentStatus::Invoice);



    slsTable = SalesTable::find('00046_036');

    slsUpdate = 0;



    custTable = CustTable::find(slsTable.CustAccount);

    transDate = today();



    try

    {



        slsLetter.transDate(transDate);

        slsLetter.update(slsTable, transDate, slsUpdate,
AccountOrder::Auto,_proforma, _print);

        info("Invoiced ");

    }

    catch

    {

        error("Failed to invoiced ");

    }





}





[Non-text portions of this message have been removed]



Sharing the knowledge on Axapta.
Visit www.frappr.com/axapta for axapta friends.




YAHOO! GROUPS LINKS




Reply via email to