Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open Beginner friendly
#12,652 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Domain
backend

Research direction

Start in codeunit 5406 "Output Jnl.-Expl. Route", procedure InsertOutputJnlLine, and in codeunit 5510 "Production Journal Mgt", procedure InsertOutputItemJnlLine, where each CheckWhse call sits in a last-operation block. Add the two local integration events right after those calls, with the signatures given in the issue, and pass the pre- and post-CheckWhse quantities. Done when both events are raised after CheckWhse with the specified parameters and the project builds.

Written by the indexing model from the issue text.

Description

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
Dominant language
AL
Stars
697
Forks
473
Avg merge
2d 15h
Merged PRs (30d)
455

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/BCApps

All issues in microsoft/BCApps

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.