ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] codeunit 815 "Sales Post Invoice" implements "Invoice Posting" - multiple publishers

Open alapenas opened this issue 3 years ago • 2 comments

Hello, would it be possible to add OnPrepareLineOnBeforeUpdateInvoicePostingBuffer event to codeunit 815 "Sales Post Invoice" implements "Invoice Posting", like this:

procedure PrepareLine(DocumentHeaderVar: Variant; DocumentLineVar: Variant; DocumentLineACYVar: Variant) 
... 
          InvoicePostingBuffer."Deferral Code" := SalesLine."Deferral Code";
         SalesPostInvoiceEvents.RunOnPrepareLineOnAfterFillInvoicePostingBuffer(InvoicePostingBuffer, SalesLine);
         
         IsHandled := false;
>         OnPrepareLineOnBeforeUpdateInvoicePostingBuffer(IsHandled); //New Event
         if not IsHandled then
             UpdateInvoicePostingBuffer(InvoicePostingBuffer, false);
 
         SalesPostInvoiceEvents.RunOnPrepareLineOnAfterUpdateInvoicePostingBuffer( 
  #endif
     [IntegrationEvent(false, false)]
     local procedure OnPrepareLineOnBeforeUpdateInvoicePostingBuffer(var IsHandled: Boolean)
     begin
     end; 

alapenas avatar Feb 27 '23 16:02 alapenas

We cannot add events in this codeunit directly. It should be added to Sales Post Invoice Events codeunit.

Please clarify why do you need this event?

AlexanderYakunin avatar May 12 '23 10:05 AlexanderYakunin

Hi Alexander, you are right, this event is not needed, my apologies for the confusion.

alapenas avatar May 22 '23 11:05 alapenas