ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 80 (Sales-Post) - OnAfterUpdateSalesHeader

Open MattiLE opened this issue 7 years ago • 0 comments

Hi AL-Team, please add the following Publisher in function UpdateSalesHeader:

LOCAL UpdateSalesHeader(VAR CustLedgerEntry : Record "Cust. Ledger Entry")
CASE GenJnlLineDocType OF
  GenJnlLine."Document Type"::Invoice:
    BEGIN
      FindCustLedgEntry(GenJnlLineDocType,GenJnlLineDocNo,CustLedgerEntry);
      SalesInvHeader."Cust. Ledger Entry No." := CustLedgerEntry."Entry No.";
      SalesInvHeader.MODIFY;
    END;
  GenJnlLine."Document Type"::"Credit Memo":
    BEGIN
      FindCustLedgEntry(GenJnlLineDocType,GenJnlLineDocNo,CustLedgerEntry);
      SalesCrMemoHeader."Cust. Ledger Entry No." := CustLedgerEntry."Entry No.";
      SalesCrMemoHeader.MODIFY;
    END;
END;

// >> New
OnAfterUpdateSalesHeader(CustLedgerEntry,SalesInvHeader,SalesCrMemoHeader,GenJnlLineDocType);
// << New

Publisher definition:
IncludeSender: false
GlobaVarAccess: false
LOCAL [IntegrationEvent] OnAfterUpdateSalesHeader(VAR CustLedgerEntry : Record "Cust. Ledger Entry";VAR SalesInvoiceHeader : Record "Sales Invoice Header";VAR SalesCrMemoHeader : Record "Sales Cr.Memo Header";GenJnlLineDocType : Integer)

For the purchase posting there is already the event(Codeunit 90 - function UpdatePurchaseHeader.

MattiLE avatar Mar 21 '19 15:03 MattiLE