Repository navigation
[Parameter request on event] - Codeunit "Sales Post Invoice Events" #30270
Description
Why do you need this change?
We need additional parameter var JobPostLine: Codeunit "Job Post-Line" on procedure RunOnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll and event OnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll
In Codeunit 80 (Sales-Post), the posting pipeline creates job-related sales lines through the Invoice Posting Interface method PrepareJobLine, which generates a temporary record: TempSalesLineJob: Record "Sales Line" temporary;
Later in the process, the event: OnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll is raised at the correct lifecycle moment - just before the temporary invoice posting buffer is deleted.
However, this event currently does not expose the Job Post-Line codeunit, which is required to execute: JobPostLine.PostJobSalesLines(...). This prevents extensions from correctly continuing the job posting flow using the prepared temporary data.
Alternatives Evaluated
-
Existing Events
Reviewed events in:
Codeunit 80 (Sales-Post)
Invoice Posting InterfaceLimitation:
No event exposes both:Prepared TempSalesLineJob
JobPostLine instance -
Reconstructing TempSalesLineJob
Attempted rebuilding from Sales Line
Limitation:Logic inside PrepareJobLine is internal and complex
High risk of inconsistencies and future breaking changes -
Independent Job Posting Call
Attempted external execution of PostJobSalesLines
Limitation:Required data exists only during posting pipeline
Timing mismatch (data already disposed after event)
Performance Considerations
Event is triggered once per document posting
Adding a codeunit parameter:
Has negligible overhead
Does not introduce additional database operations
Any additional logic executes on already-prepared temporary data
Data Sensitivity
No new data structures are exposed
JobPostLine:
Does not contain sensitive data by itself
Operates within the same posting security context
Existing event already exposes sales and posting data
Benefits
Enables correct reuse of standard job posting logic
Avoids duplication of internal business logic
Improves extensibility of the sales posting pipeline
Aligns with existing extensibility patterns in Business Central
Enables correct reuse of standard job posting logic
Avoids duplication of internal business logic
Improves extensibility of the sales posting pipeline
Aligns with existing extensibility patterns in Business Central
Describe the request
Existing event :
procedure RunOnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll(var SalesHeader: Record "Sales Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var TotalSalesLine: Record "Sales Line"; var TotalSalesLineLCY: Record "Sales Line"; var InvoicePostingParameters: Record "Invoice Posting Parameters")
begin
OnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll(SalesHeader, GenJnlPostLine, TotalSalesLine, TotalSalesLineLCY, InvoicePostingParameters);
end;
[IntegrationEvent(false, false)]
local procedure OnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll(var SalesHeader: Record "Sales Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var TotalSalesLine: Record "Sales Line"; var TotalSalesLineLCY: Record "Sales Line"; var InvoicePostingParameters: Record "Invoice Posting Parameters")
begin
end;Modified event :
procedure RunOnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll(var SalesHeader: Record "Sales Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var TotalSalesLine: Record "Sales Line"; var TotalSalesLineLCY: Record "Sales Line"; var InvoicePostingParameters: Record "Invoice Posting Parameters"; var JobPostLine: Codeunit "Job Post-Line")
begin
OnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll(SalesHeader, GenJnlPostLine, TotalSalesLine, TotalSalesLineLCY, InvoicePostingParameters);
end;
[IntegrationEvent(false, false)]
local procedure OnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll(var SalesHeader: Record "Sales Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var TotalSalesLine: Record "Sales Line"; var TotalSalesLineLCY: Record "Sales Line"; var InvoicePostingParameters: Record "Invoice Posting Parameters"; var JobPostLine: Codeunit "Job Post-Line")
begin
end;Internal work item: AB#647451
Activity
github-actions commentedon Jun 16, 2026
Hi Companial/DeimantėJasaitytė (@exnihiloo),
Thank you for your extensibility request. Unfortunately, this request cannot be implemented.
Reason: Implementation would require changing the public procedure signature of RunOnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll by adding a new parameter, which is a breaking change. Because the request contains multiple linked changes, the entire request must be rejected.
Note
Automatically generated by the Triage Agent — advisory only. An engineer will review before any action is taken.
Tip
Not accurate? Reply with
/not-accurate(optional: add a short explanation). Your feedback improves future responses.exnihiloo commentedon Jun 17, 2026
/not-accurate hello, can engineer review this?
github-actions commentedon Jun 17, 2026
✅ Feedback recorded
Thanks — your
/not-accuratefeedback has been logged and will be reviewed.exnihiloo commentedon Jun 23, 2026
Hello, any news regarding this one?
AleksandricMarko commentedon Jun 24, 2026
Hello Companial/DeimantėJasaitytė (@exnihiloo),
Could you explain us a purpose, why you need "JobPostLine" in your extension
exnihiloo commentedon Jun 29, 2026
Marko Aleksandric (@AleksandricMarko)
Hello, we need JobPostLine because we are running PostJobSalesLines on RunOnPostLinesOnBeforeTempInvoicePostingBufferDeleteAll for our solution standard PostJobSalesLines procedure (which runs from PostLines repeat loop) will not run as we avoid using TempInvoicePostingBuffer and we are using our own custom TempPostingBuffer table, for that case we need var JobPostLine: Codeunit "Job Post-Line" since the proceudre PostJobSalesLines uses global variable TempSalesLineJob which is set by running PrepareJobLine on codeunit 815 "Sales Post Invoice" implements "Invoice Posting".
exnihiloo commentedon Aug 7, 2026
Marko Aleksandric (@AleksandricMarko)
Good day, any decisions regarding this case?
AleksandricMarko commentedon Aug 7, 2026
Hi Companial/DeimantėJasaitytė (@exnihiloo),
I reopened issue so we can discuss about solution,
Adding parameter to public procedure is not possible, so we can discus just on different approaches.
Would it be possible for you adding new event somewhere else as alternative?
exnihiloo commentedon Aug 10, 2026
Hello, Marko Aleksandric (@AleksandricMarko),
if it's not possible to add parameter on the existing procedure and event, would it be possible to add new procedure and event which is copy of existing procedure just with additional parameter JobPostLine?
On codeunit 815 "Sales Post Invoice" implements "Invoice Posting"
we need this procedure in the exact place, before TempInvoicePostingBuffer deletion
AleksandricMarko commentedon Aug 10, 2026
Hi Companial/DeimantėJasaitytė (@exnihiloo),
Would it be possible to add new event before
Just to avoid having 2 events next to each other (we can include skip pattern for these 2 lines if it is needed)?
exnihiloo commentedon Aug 13, 2026
Hello, Marko Aleksandric (@AleksandricMarko),
yes that would be great! Will you keep the same parameters plus adding JobPostLine?
exnihiloo commentedon Aug 21, 2026
Hello, Marko Aleksandric (@AleksandricMarko),
any information when this request will be added?
AleksandricMarko commentedon Sep 18, 2026
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. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
PR: microsoft/BCApps#10513