Post Sales Order From Job Queue

samantha73samantha73 Member Posts: 110
Hi All
We have a process where sales shipment is created manually and a background job is scheduled to post shipped but not invoiced orders. I have used if codeunit.run method to capture errors and the use below codeunit for each sales order. Not sure if this is best codeunit as others such as sales-post yes/no have pop ups
codeunit 5000 "MYPostInvoiceSingleSalesOrder"
{
    TableNo = "Sales Header";

    trigger OnRun()
    var
    begin
        PostSingleSalesOrder(Rec);
    end;

    procedure PostSingleSalesOrder(var SalesHeader: Record "Sales Header"): Boolean
    var

        SalesBatchPostMgt: Codeunit "Sales Batch Post Mgt.";
        PostingDate: Date;
    begin
        PostingDate := TODAY();

        SalesBatchPostMgt.RunBatch(SalesHeader, true, PostingDate, true, true, false, true);//incoice only

    end;

}

Answers

  • lubostlubost Member Posts: 630
    1. Filtering shipped not invoiced lines missing - how to find document to invoice.
    2. Nullify quantity to ship missing - standard functionality fills this with outstanding quantity.
Sign In or Register to comment.