ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] codeunit 80 "Sales-Post" - OnFillInvoicePostingBufferOnBeforeUpdateInvoicePostBuffer

Open alapenas opened this issue 3 years ago • 5 comments

Hello, would it be possible to add OnFillInvoicePostingBufferOnBeforeUpdateInvoicePostBuffer event to codeunit 80 "Sales-Post", like this:

   local procedure FillInvoicePostingBuffer(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; SalesLineACY: Record "Sales Line")
... 

       IsHandled := false;
>        OnFillInvoicePostingBufferOnBeforeUpdateInvoicePostBuffer(InvoicePostBuffer, TempInvoicePostBuffer, SalesHeader, SalesLine, IsHandled); //New Event
       if not IsHandled then
           UpdateInvoicePostBuffer(InvoicePostBuffer, false);
   [IntegrationEvent(false, false)]
   local procedure OnFillInvoicePostingBufferOnBeforeUpdateInvoicePostBuffer(InvoicePostBuffer: Record "Invoice Post. Buffer" temporary; var TempInvoicePostBuffer: Record "Invoice Post. Buffer" temporary; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var IsHandled: Boolean)
   begin
   end;

alapenas avatar May 22 '23 11:05 alapenas

You ask to add event into obsoleted code, currently we have tag CLEAN23 here, therefore it is possible to add event in master. But it is not possible to add same event in v. 22. Do you really need this, can you provide more details for your scenario?

AlexanderYakunin avatar May 31 '23 08:05 AlexanderYakunin

Hi Alexander, Do you mean that procedure FillInvoicePostingBuffer() will become obsolete in the next major release BC23 and we will start using Interface Codeunit?

#if not CLEAN20
               if UseLegacyInvoicePosting() then
                   FillInvoicePostingBuffer(SalesHeader, SalesLine, SalesLineACY)
               else
#endif
               InvoicePostingInterface.PrepareLine(SalesHeader, SalesLine, SalesLineACY);
           end;

Our goal is to replace the procedure UpdateInvoicePostBuffer() with our custom procedure. Probably it would be better to add publisher into the UpdateInvoicePostBuffer(). Would it be possible?

alapenas avatar May 31 '23 10:05 alapenas

Just to update this request, seeing the BC23 pre-release version, would it be possible to add this event here? codeunit 817 "Service Post Invoice"

   local procedure UpdateInvoicePostingBuffer(InvoicePostingBuffer: Record "Invoice Posting Buffer"; ServiceLine: Record "Service Line")
   begin
      IsHandled := false;
>        OnBeforeUpdateInvoicePostBuffer(InvoicePostBuffer, TempInvoicePostBuffer, SalesHeader, SalesLine, IsHandled); //New Event
      if IsHandled then
         exit;

       InvoicePostingBuffer."Dimension Set ID" := ServiceLine."Dimension Set ID";
       if InvoicePostingBuffer.Type = InvoicePostingBuffer.Type::"Fixed Asset" then begin
           FALineNo := FALineNo + 1;

gretanorv avatar Sep 15 '23 09:09 gretanorv

Why you are not using new implementation, and still pushing changes into obsoleted one? If you are doing new solution, any reason for doing that? Making changes in obsoleted code is very difficult, especially across versions.

AlexanderYakunin avatar Sep 15 '23 10:09 AlexanderYakunin

Looking into old issues, we cannot make this change.

AlexanderYakunin avatar Jan 16 '24 13:01 AlexanderYakunin