Skip to content

[Extensibility Request] issue 30362: add OnPostDocumentLinesOnBeforeInsertPostedHeaders event to Service-Post - #9778

Open
AleksandricMarko wants to merge 1 commit into
mainfrom
ai-ext-fix/ext_issue-30362
Open

[Extensibility Request] issue 30362: add OnPostDocumentLinesOnBeforeInsertPostedHeaders event to Service-Post#9778
AleksandricMarko wants to merge 1 commit into
mainfrom
ai-ext-fix/ext_issue-30362

Conversation

@AleksandricMarko

@AleksandricMarko AleksandricMarko commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

The reporter builds solutions with custom Service document types and needs to control which posted document is created during Service posting. Codeunit 5980 Service-Post currently hardcodes the decision of whether a posted service invoice or credit memo header is created, so extensions cannot alter this flow the way they can in Sales-Post. This PR adds an IsHandled integration event immediately before that logic, bringing Service-Post extensibility in line with Sales-Post.

Source issue repository: microsoft/AlAppExtensions; issue number: 30362

Changes Made

  • OnPostDocumentLinesOnBeforeInsertPostedHeaders - new IsHandled integration event raised in PostDocumentLines right before the posted service invoice/credit memo header creation, letting subscribers replace the standard decision; the same change is propagated to the NA and IT layer counterparts.

Fixes AB#643301

…rs event to Service-Post

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AleksandricMarko AleksandricMarko added event-request SCM GitHub request for SCM area labels Jul 28, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 28, 2026
@AleksandricMarko
AleksandricMarko marked this pull request as ready for review July 28, 2026 10:02
@AleksandricMarko
AleksandricMarko requested a review from a team July 28, 2026 10:02

@qasimikram qasimikram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S1 - The new IsHandled path is unsafe because it skips Serv-Documents Mgt. preparation, which initializes temporary posted headers, journal document parameters, logs, comments, and incoming-document state. The subscriber only receives ServiceHeader and document-number variables, so it cannot initialize the same codeunit instance before PostDocumentLines and finalization consume that state. Please narrow the extension point or expose a safe replacement contract, and add a subscriber-path test covering posted headers, lines, and journal document numbers.

S2 - Pass ServiceHeader by value unless a specific late-mutation contract is required and tested. The equivalent Sales-Post event uses a value parameter, and var permits mutation after posting checks and initialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

event-request SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants