[Event Request] codeunit 80 "Sales-Post" - OnFillInvoicePostingBufferOnBeforeUpdateInvoicePostBuffer
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;
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?
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?
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;
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.
Looking into old issues, we cannot make this change.