Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[W1][MultiObjects] Output journal lines: event after CheckWhse in codeunits 5406 "Output Jnl.-Expl. Route" and 5510 "Production Journal Mgt"

オープン 初心者向け
#12,652 コメント 3 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@PredragMaricic がすでに取り組んでいます。

2026年10月14日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
66/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
領域
backend

調査の方向性

codeunit 5406 "Output Jnl.-Expl. Route" の プロシージャ InsertOutputJnlLine と、codeunit 5510 "Production Journal Mgt" の プロシージャ InsertOutputItemJnlLine から始めてください。どちらも、各 CheckWhse の呼び出しは最後の操作のブロック内にあります。Issue に記載されたシグネチャで、これらの呼び出しの直後に2つのローカル統合イベントを追加し、CheckWhse の前後の数量を渡してください。両方のイベントが指定されたパラメータで CheckWhse の後に発生し、プロジェクトがビルドできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Approved Team: SCM
Why do you need this change?

At a location whose "Prod. Output Whse. Handling" is Inventory Put-away, the output journal lines for a production order's last operation get "Output Quantity" 0, because CheckWhse (table extension 99000758 "Mfg. Item Journal Line") sets the quantity to post to 0 before the line is validated. Standard expects the output to be posted through the Inventory Put-away.

Some output should not be put away: it stays in the work center's output bin (for example output that is moved on later by an Internal Movement, or that a later process consumes from the output bin). An extension that lets such output be posted straight from the journal has to give the last operation's line its quantity back after CheckWhse zeroed it.

Today the only way to do that is to capture the quantity at an earlier event and write it back later:

  • Codeunit 5406 "Output Jnl.-Expl. Route": the quantity is only exposed in OnAfterCalcBaseQtyToPost(var ProdOrderRoutingLine; var BaseQty). Subscribers to an event run in no defined order, so an extension that captures BaseQty there cannot know whether another extension changes it afterwards. The captured value may be standard's quantity instead of the one another extension proposed, and the operator then sees the wrong quantity on the exploded line.
  • Codeunit 5510 "Production Journal Mgt": the quantity is exposed in OnInsertOutputItemJnlLineOnAfterAssignTimes(...; var QtyToPost) right before CheckWhse, with the same ordering problem for any other extension subscribing to that event.

An event raised right after CheckWhse, carrying both the quantity before CheckWhse and the quantity to post, lets an extension decide the last operation's quantity from the final value every other subscriber already shaped, with no capture state and no dependency on subscriber order. It also lets other warehouse extensions (for example ones that handle production output through their own documents) see and adjust what CheckWhse decided.

Describe the request

Please add one integration event after CheckWhse in each of the two procedures that create output journal lines. Both are needed for the same scenario: the Production Journal and the Output Journal's Explode Routing must behave the same for the same production order.

Codeunit 5406 "Output Jnl.-Expl. Route", procedure InsertOutputJnlLine

            if (LocationCode <> '') and LastOperation then begin
                QtyPerLineBeforeCheckWhse := QtyPerLine;
                ItemJnlLine.CheckWhse(LocationCode, QtyPerLine);
                OnInsertOutputJnlLineOnAfterCheckWhse(ItemJnlLine, ProdOrderLine, QtyPerLineBeforeCheckWhse, QtyPerLine);
            end;
            if ItemJnlLine.SubcontractingWorkCenterUsed() then
                ItemJnlLine.Validate("Output Quantity", 0)
            else
                ItemJnlLine.Validate("Output Quantity", QtyPerLine);
[IntegrationEvent(false, false)]
local procedure OnInsertOutputJnlLineOnAfterCheckWhse(var ItemJournalLine: Record "Item Journal Line"; ProdOrderLine: Record "Prod. Order Line"; QtyPerLineBeforeCheckWhse: Decimal; var QtyPerLine: Decimal)
begin
end;

Codeunit 5510 "Production Journal Mgt", procedure InsertOutputItemJnlLine

        if (ProdOrderLine."Location Code" <> '') and IsLastOperation(ProdOrderRtngLine) then begin
            QtyToPostBeforeCheckWhse := QtyToPost;
            ItemJnlLine.CheckWhse(ProdOrderLine."Location Code", QtyToPost);
            OnInsertOutputItemJnlLineOnAfterCheckWhse(ItemJnlLine, ProdOrderLine, ProdOrderRtngLine, QtyToPostBeforeCheckWhse, QtyToPost);
        end;
[IntegrationEvent(false, false)]
local procedure OnInsertOutputItemJnlLineOnAfterCheckWhse(var ItemJournalLine: Record "Item Journal Line"; ProdOrderLine: Record "Prod. Order Line"; ProdOrderRoutingLine: Record "Prod. Order Routing Line"; QtyToPostBeforeCheckWhse: Decimal; var QtyToPost: Decimal)
begin
end;

Neither event uses the IsHandled pattern: CheckWhse still runs, and a subscriber only adjusts the quantity that follows from it.

Provide an implementation (optional)
  • I will provide the implementation for this extensibility request
主要言語
AL
スター
714
フォーク
482
平均マージ
3日 1時間
マージ済み PR(30日)
546

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/BCApps のほかの issue

microsoft/BCApps の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。