[W1][MultiObjects] Output journal lines: event after CheckWhse in codeunits 5406 "Output Jnl.-Expl. Route" and 5510 "Production Journal Mgt"
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
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 capturesBaseQtythere 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 beforeCheckWhse, 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/BCApps
-
Team: SCM
Difficulty 1/5 Under an hour Newbie friendliness 75/100
microsoft/BCApps#12623 · 1 comment ·
Maintainers usually reply within 1 day
-
Team: Finance
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Team: SCM
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/BCApps#12559 · 1 comment ·
Maintainers usually reply within 1 day
-
[W1][Event Request] Page 8076 "Serv. Comm. WO Vend. Contract"Possibly taken @business-central-extensibility-bot claimed this 6 days ago. OpenApproved event-request ext-ready-to-implement Team: Finance
Difficulty 1/5 Under an hour Newbie friendliness 85/100
microsoft/BCApps#12423 · 1 comment ·
Maintainers usually reply within 1 day
-
missing-info Team: Finance
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
microsoft/BCApps#12422 · 3 comments ·
Maintainers usually reply within 1 day
All issues in microsoft/BCApps
Similar issues
-
Notifications pagination accepts NaN and negative LIMIT/OFFSETPossibly taken @Senthil455 claimed this today. OpenBUGS MEDIUM
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
elixpo/blogs.elixpo#419 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug]: agent_final_response still returns the abandoned branch's answer after navigate moves HEAD backPossibly taken @enyst claimed this today. Openbug priority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenHands/software-agent-sdk#5822 ·
Maintainers usually reply within 1 day
-
area: server enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
scs0209/laya-guard#52 ·
Maintainers usually reply within 1 day
-
priority:high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100