Post Sales Invoice

Zumzum Financials Knowledge Base

    Class : SalesInvoicePostService

    Function : PostSalesInvoices

    Input : List<Sales_Invoice__c>

    Output : void

    Please follow the below steps to post multiple invoices.

    1. Prepare the list collection ‘List<Sales_Invoice__c>’ to supply as an input for the above function. For this, you can execute a SOQL command to fetch all the sales invoices which should be posted or you can use the output of the function ‘CreateSalesinvoices’ as explained above in the document.
    2. Do not execute this inside batch processing, since this function will take care of the batch processing internally.

    Sample Code:

    /* Post invoices */
    List<Sales_Invoice__c> lstInvoices = [Select id from Sales_Invoice__c where Status__c = 'Draft' order by createddate desc limit 20];
    SalesInvoicePostService objInvoiceHandler = new SalesInvoicePostService();
    in Integration Tags: IntegrationPost Sales InvoiceSales Invoice