ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 80 "Sales-Post" - procedure "PostSalesLine" - event "OnPostSalesLineOnBeforeInsertInvoiceLine" - Add new Parameters

Open StHillmann opened this issue 6 years ago • 3 comments

Due to handle our own logic, we need additional parameters for the standard event "OnPostSalesLineOnBeforeInsertInvoiceLine" in Codeunit 80 "Sales-Post", procedure "PostSalesLine".

OLD CODE:

if SalesHeader.Invoice then
    if SalesHeader."Document Type" in [SalesHeader."Document Type"::Order, SalesHeader."Document Type"::Invoice] then begin
        OnPostSalesLineOnBeforeInsertInvoiceLine(SalesHeader, SalesLine, IsHandled);
	if not IsHandled then begin

NEW CODE:

if SalesHeader.Invoice then
    if SalesHeader."Document Type" in [SalesHeader."Document Type"::Order, SalesHeader."Document Type"::Invoice] then begin
        OnPostSalesLineOnBeforeInsertInvoiceLine(SalesHeader, SalesLine, xSalesLine, SalesInvHeader, SalesCrMemoHeader, IsHandled); // start kvspsa - Added new parameters
	if not IsHandled then begin

OLD PUBLISHER:

[IntegrationEvent(false, false)]
local procedure OnPostSalesLineOnBeforeInsertInvoiceLine(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var IsHandled: Boolean)
begin
end;

NEW PUBLISHER:

[IntegrationEvent(false, false)]
// start kvspsa - New parameters added
local procedure OnPostSalesLineOnBeforeInsertInvoiceLine(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var xSalesLine: Record "Sales Line"; var SalesInvHeader: Record "Sales Invoice Header"; var SalesCrMemoHdr: Record "Sales Cr.Memo Header"; var IsHandled: Boolean)
// stop kvspsa
begin
end;

StHillmann avatar Mar 24 '20 14:03 StHillmann

Hi @StHillmann . I have a question about parameters you asked to add. Why do you need SalesCrMemoHeader on before insert of sales invoice header? The same question is relevant for #6564. In these two cases you asked for equal set of parameters for different types of insertions?

RomanZanizdra avatar Mar 27 '20 06:03 RomanZanizdra

Hi @RomanZanizdra you are totally right! Our background processing has been one procedure which takes both parameters, but I already have divided it up. @AlexanderYakunin Please remove "SalesCrMemoHeader" as parameter and sorry for this...

StHillmann avatar Mar 27 '20 13:03 StHillmann

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.

bc-ghost avatar Mar 31 '20 06:03 bc-ghost