[Extensibility Request] issue 30337: add OnCreateProdOrderLineOnBeforeCreateProdOrderLineFromItem event#9441
Draft
AleksandricMarko wants to merge 2 commits into
Draft
[Extensibility Request] issue 30337: add OnCreateProdOrderLineOnBeforeCreateProdOrderLineFromItem event#9441AleksandricMarko wants to merge 2 commits into
AleksandricMarko wants to merge 2 commits into
Conversation
…LineFromItem event Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| OnAfterCreateProdOrderLine(ProdOrder, VariantCode, ErrorOccured); | ||
| end; | ||
|
|
||
| local procedure CreateProdOrderLineFromItem(ProdOrder: Record "Production Order"; VariantCode: Code[10]; var ErrorOccured: Boolean) |
Contributor
Author
There was a problem hiding this comment.
@copilot ProdOrder: Record "Production Order" should be with var and renamed to ProductionOrder
Contributor
There was a problem hiding this comment.
Updated in 20e7f28: CreateProdOrderLineFromItem now uses var ProductionOrder: Record "Production Order", and the internal references were renamed from ProdOrder to ProductionOrder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The issue author needs to completely replace the standard
Source Type = Itemprocessing inCreateProdOrderLineunder specific business conditions, executing their own production order line creation and controlling the resultingErrorOccuredoutcome. None of the existing events (OnCreateProdOrderLineOnBeforeInitProdOrderLine,OnBeforeProdOrderLineInsert,OnAfterProdOrderLineInsert,OnAfterCreateProdOrderLine) can bypass the standard flow. This PR adds anIsHandled-based integration event that lets an extension take full ownership of the item-line creation and setErrorOccured.Source issue repository: microsoft/AlAppExtensions; issue number: 30337
Changes Made
CreateProdOrderLine(codeunit 99000787 "Create Prod. Order Lines") - extracted the standardSource Type = Itembranch into a new local procedureCreateProdOrderLineFromItemand raised a newOnCreateProdOrderLineOnBeforeCreateProdOrderLineFromItemintegration event withvar IsHandledandvar ErrorOccuredbefore calling it, so subscribers can replace the standard item-line creation and report the outcome; whenIsHandledstays false the original behavior and all existing events are preserved.OnCreateProdOrderLineOnBeforeCreateProdOrderLineFromItem- new[IntegrationEvent(false, false)]publisher exposingIsHandled,ErrorOccured, theProduction Orderrecord, and the variant code.Fixes AB#641918