You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 19, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 19, 2026. It is now read-only.
I need this change to be able to use Service post and Send for Service Header document type Order.
Describe the request
Describe the request
Hello, I was wondering if we could get two events in Codeunit 5979 "Service-Post and Send" ΓÇö OnBeforeConfirmPostAndSend and OnBeforePost?
Today the Code() procedure hard-codes the supported document types (only Invoice and Credit Memo) and calls Service-Post directly, so there is no way to support posting a Service Order from Post & Send, or to substitute the posting routine, without copying the whole codeunit. These two events would let us do that from a subscriber.
[IntegrationEvent(false, false)]
localprocedure OnBeforeConfirmPostAndSend(var ServiceHeader: Record "Service Header"; var IsHandled: Boolean)beginend;
[IntegrationEvent(false, false)]
localprocedure OnBeforePost(var ServiceHeader: Record "Service Header"; var IsHandled: Boolean; var SkipPost: Boolean)beginend;
With OnBeforeConfirmPostAndSend, a subscriber can accept additional document types (e.g. Order) by setting IsHandled, which runs ConfirmPostAndSend and skips the else Error. With OnBeforePost, a subscriber can replace the posting (e.g. the Ship/Consume/Invoice dialog for Orders) via IsHandled, and use SkipPost to stop before SendPostedDocumentRecord when nothing was posted.
Performance considerations: Please add a brief statement about the expected execution frequency of these new IsHandled events and their anticipated performance impact.
Data sensitivity review: Please confirm that the requested events do not expose sensitive data, or explain the sensitivity implications if they do.
Multi-extension interaction: Please acknowledge the risk of multiple extensions subscribing to these events and briefly explain how that risk is acceptable or should be mitigated.
Please update the issue with the missing details. We'll automatically re-analyze once updated.
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.
The events are executed only once per invocation of Codeunit 5979, during the Post & Send process. They are lightweight integration events with no additional processing in the standard implementation. The performance impact is therefore expected to be negligible. Subscribers should, as usual, avoid expensive operations or unnecessary database queries unless required for their specific scenario.
Data sensitivity review
These events expose the Service Header record, which contains the information already available to code executing within the Service Post & Send process. They do not introduce access to a new data source or expose credentials, authentication information, or other inherently sensitive system data. Extensions subscribing to the events should follow the normal Business Central data-access and permission model when handling Service Header data.
Multi-extension interaction
We acknowledge that multiple extensions may subscribe to these events and potentially modify the IsHandled/SkipPost parameters. This is an accepted pattern for Business Central integration events, but subscribers should use these parameters carefully and only handle scenarios they explicitly support. In particular, subscribers should check the document type and exit when the event is not relevant to them, as in the proposed implementation. This minimizes interference between extensions and allows multiple extensions to coexist.
Critical posting replacement handling: Please confirm that you understand OnBeforePost(var ServiceHeader, var IsHandled, var SkipPost) can bypass the standard Service-Post routine, and explain how your extension will safely replace that posting logic.
Posted-document/send coordination: Please explain how your implementation will ensure SkipPost is set only when no posted document exists, so SendPostedDocumentRecord is not reached in an invalid state.
Please update the issue with the missing details. We'll automatically re-analyze once updated.
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.
Critical posting replacement handling
I understand that OnBeforePost(var ServiceHeader, var IsHandled, var SkipPost) allows an extension to bypass the standard Service-Post codeunit by setting IsHandled := true.
Our intended use case is to support Service Header document type Order, where the standard Service-Post flow is not sufficient for our business process. In the subscriber, we would take responsibility for the complete posting operation, including all required validation and posting logic, and ensure that the appropriate posted document is created before the flow continues to the sending logic.
We would only set IsHandled := true when our subscriber has explicitly taken over the posting operation. We understand that doing so means the extension is responsible for maintaining the expected posting state and for ensuring that the standard posting routine is not also executed.
Posted-document/send coordination
We also understand the purpose of SkipPost.
Our subscriber would set SkipPost := true only when it intentionally handles the flow without creating a posted document and therefore the subsequent SendPostedDocumentRecord(ServiceHeader, TempDocumentSendingProfile) call must not be reached.
If our replacement posting logic successfully creates the expected posted document, SkipPost would remain false, allowing the existing flow to continue to OnAfterPostAndBeforeSend, Commit(), and SendPostedDocumentRecord.
In other words, the extension will ensure that SendPostedDocumentRecord is only reached when the posting operation has produced the appropriate posted document/state expected by the sending logic. We will not use SkipPost merely to suppress an error or to bypass posting while still allowing the standard send operation to execute.
The proposed events are intended to provide a supported extension point for this scenario rather than requiring a copy of the entire Service-Post and Send codeunit.
✅ Analysis complete - ready for further processing
Implementation:
Add OnCodeOnBeforeConfirmPostAndSend before the hard-coded document type validation in Code() and OnCodeOnBeforePost before the standard Service-Post execution so extensions can allow additional document types and optionally take over posting.
Location in Code() procedure:
localprocedure "Code"()var
TempDocumentSendingProfile: Record "Document Sending Profile" temporary;
ServicePost: Codeunit "Service-Post";
ConfirmPostAndSendIsHandled: Boolean; // NEW
PostIsHandled: Boolean; // NEW
SkipPost: Boolean; // NEWbegin
OnBeforeCode(ServiceHeader);
ConfirmPostAndSendIsHandled := false; // NEW
OnCodeOnBeforeConfirmPostAndSend(ServiceHeader, ConfirmPostAndSendIsHandled); // NEWif ConfirmPostAndSendIsHandled or// NEW (ServiceHeader."Document Type" in [ServiceHeader."Document Type"::Invoice, ServiceHeader."Document Type"::"Credit Memo"]) // NEWthenbeginifnot ConfirmPostAndSend(ServiceHeader, TempDocumentSendingProfile) thenexit;
endelse
Error(NotSupportedDocumentTypeErr, ServiceHeader."Document Type");
TempDocumentSendingProfile.CheckElectronicSendingEnabled();
ValidateElectronicFormats(TempDocumentSendingProfile);
PostIsHandled := false; // NEW
SkipPost := false; // NEW
OnCodeOnBeforePost(ServiceHeader, PostIsHandled, SkipPost); // NEWifnot PostIsHandled then// NEWCODEUNIT.Run(CODEUNIT::"Service-Post", ServiceHeader);
if SkipPost then// NEWexit; // NEW
OnAfterPostAndBeforeSend(ServiceHeader);
Commit();
ServicePost.SendPostedDocumentRecord(ServiceHeader, TempDocumentSendingProfile);
OnAfterCode(ServiceHeader);
end;
Event Publisher (add at the end of the codeunit with other events):
[IntegrationEvent(false, false)]
localprocedure OnCodeOnBeforeConfirmPostAndSend(var ServiceHeader: Record "Service Header"; var IsHandled: Boolean)beginend;
[IntegrationEvent(false, false)]
localprocedure OnCodeOnBeforePost(var ServiceHeader: Record "Service Header"; var IsHandled: Boolean; var SkipPost: Boolean)beginend;
File:ServicePostandSend.Codeunit.al
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.
Activity
github-actions commentedon Aug 13, 2026
Hi Adrian Langelid (@AlaAuz),
Thank you for your extensibility request. To help us process it efficiently, please update the issue to include the required information.
📚 Extensibility Guidelines
Missing Information:
Please update the issue with the missing details. We'll automatically re-analyze once updated.
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.AlaAuz commentedon Aug 14, 2026
Performance considerations
The events are executed only once per invocation of Codeunit 5979, during the Post & Send process. They are lightweight integration events with no additional processing in the standard implementation. The performance impact is therefore expected to be negligible. Subscribers should, as usual, avoid expensive operations or unnecessary database queries unless required for their specific scenario.
Data sensitivity review
These events expose the Service Header record, which contains the information already available to code executing within the Service Post & Send process. They do not introduce access to a new data source or expose credentials, authentication information, or other inherently sensitive system data. Extensions subscribing to the events should follow the normal Business Central data-access and permission model when handling Service Header data.
Multi-extension interaction
We acknowledge that multiple extensions may subscribe to these events and potentially modify the IsHandled/SkipPost parameters. This is an accepted pattern for Business Central integration events, but subscribers should use these parameters carefully and only handle scenarios they explicitly support. In particular, subscribers should check the document type and exit when the event is not relevant to them, as in the proposed implementation. This minimizes interference between extensions and allows multiple extensions to coexist.
github-actions commentedon Aug 14, 2026
Hi Adrian Langelid (@AlaAuz),
Thank you for your extensibility request. To help us process it efficiently, please update the issue to include the required information.
📚 Extensibility Guidelines
Missing Information:
OnBeforePost(var ServiceHeader, var IsHandled, var SkipPost)can bypass the standardService-Postroutine, and explain how your extension will safely replace that posting logic.SkipPostis set only when no posted document exists, soSendPostedDocumentRecordis not reached in an invalid state.Please update the issue with the missing details. We'll automatically re-analyze once updated.
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.AlaAuz commentedon Aug 28, 2026
Critical posting replacement handling
I understand that OnBeforePost(var ServiceHeader, var IsHandled, var SkipPost) allows an extension to bypass the standard Service-Post codeunit by setting IsHandled := true.
Our intended use case is to support Service Header document type Order, where the standard Service-Post flow is not sufficient for our business process. In the subscriber, we would take responsibility for the complete posting operation, including all required validation and posting logic, and ensure that the appropriate posted document is created before the flow continues to the sending logic.
We would only set IsHandled := true when our subscriber has explicitly taken over the posting operation. We understand that doing so means the extension is responsible for maintaining the expected posting state and for ensuring that the standard posting routine is not also executed.
Posted-document/send coordination
We also understand the purpose of SkipPost.
Our subscriber would set SkipPost := true only when it intentionally handles the flow without creating a posted document and therefore the subsequent SendPostedDocumentRecord(ServiceHeader, TempDocumentSendingProfile) call must not be reached.
If our replacement posting logic successfully creates the expected posted document, SkipPost would remain false, allowing the existing flow to continue to OnAfterPostAndBeforeSend, Commit(), and SendPostedDocumentRecord.
In other words, the extension will ensure that SendPostedDocumentRecord is only reached when the posting operation has produced the appropriate posted document/state expected by the sending logic. We will not use SkipPost merely to suppress an error or to bypass posting while still allowing the standard send operation to execute.
The proposed events are intended to provide a supported extension point for this scenario rather than requiring a copy of the entire Service-Post and Send codeunit.
github-actions commentedon Aug 28, 2026
✅ Analysis complete - ready for further processing
Implementation:
Add
OnCodeOnBeforeConfirmPostAndSendbefore the hard-coded document type validation inCode()andOnCodeOnBeforePostbefore the standardService-Postexecution so extensions can allow additional document types and optionally take over posting.Location in
Code()procedure:Event Publisher (add at the end of the codeunit with other events):
File:
ServicePostandSend.Codeunit.alNote
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.AleksandricMarko commentedon Oct 16, 2026
There is an active PR for this issue
microsoft/BCApps#10992
It will be completed in next period.
As this repo will be archived in few days, closing the issue. Please track progress on the PR