December 2019
Beginner to intermediate
770 pages
16h 14m
English
When provided with the numbers of our item and customer, the CreateSalesInvoiceForCustomerWithLineForItem helper function has to create a new sales invoice with one line, making use of the CreateSalesDocumentWithItem helper function from the standard library Library - Sales codeunit (130509). The following is what its implementation looks like:
local procedure CreateSalesInvoiceForCustomerWithLineForItem( CustomerNo: Code[20]; ItemNo: Code[20]): Code[20]var SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line";begin with SalesHeader do begin LibrarySales.CreateSalesDocumentWithItem( SalesHeader, SalesLine, "Document Type"::Invoice, CustomerNo, ItemNo, 0, '', 0D); exit("No."); end; ...Read now
Unlock full access