Skip to content

[Subcontracting] Bug 634720: Production Routing factbox count must match drill-down operation filter#8157

Open
ChethanT wants to merge 2 commits into
mainfrom
bugs/Subcontracting/634720-POFactboxRoutingCount
Open

[Subcontracting] Bug 634720: Production Routing factbox count must match drill-down operation filter#8157
ChethanT wants to merge 2 commits into
mainfrom
bugs/Subcontracting/634720-POFactboxRoutingCount

Conversation

@ChethanT
Copy link
Copy Markdown
Contributor

@ChethanT ChethanT commented May 13, 2026

Summary

  • In the Subcontracting Details factbox on a Purchase Order, the Production Routing field showed a count (e.g. 4) that didn't match the single routing line opened by its drill-down. Same issue on the Transfer Order factbox.
  • Root cause: CalcNoOfProductionOrderRoutings in codeunit 99001559 Subc. ProdO. Factbox Mgmt. filtered the Prod. Order Routing Line table by Status + Prod. Order No. + Routing Reference No. only, while its drill-down counterpart ShowProductionOrderRouting additionally filters by Routing No. and Operation No.. The count therefore returned all operations of the production order line; the drill-down always returns the single linked routing operation.
  • Fix: Add the two missing filters in CalcNoOfProductionOrderRoutings so both methods apply the same filter set. Single-point fix shared by both Subc. Purchase Line Factbox and Subc. Transfer Line Factbox.

Test

Added CalcNoOfProductionOrderRoutingsReturnsOneForSubcontractingPurchaseLine ([SCENARIO 634720]) in codeunit 139989 Subc. Subcontracting Test (src/Apps/W1/Subcontracting/Test/src/Codeunits/Tests/SubcSubcontractingTest.Codeunit.al). The test:

  1. Creates a production order whose routing has multiple operations (asserts Count() > 1 as a precondition to detect the bug),
  2. Creates a subcontracting purchase order for the subcontracting work center, and
  3. Asserts CalcNoOfProductionOrderRoutings(PurchaseLine) = 1, matching the drill-down.

Without the fix, the assertion would observe the total number of routing operations of the prod-order line (e.g. 4).

Fixes AB#634720

🤖 Generated with Claude Code

…tch drill-down operation filter

Aligned CalcNoOfProductionOrderRoutings in codeunit "Subc. ProdO. Factbox
Mgmt." with ShowProductionOrderRouting by adding the missing "Routing No."
and "Operation No." filters. Previously, the factbox count returned all
routing operations of the production order line (e.g. 4), while the
drill-down filtered to the single linked operation (always 1) — so the
count and drill-down were inconsistent. Both Subc. Purchase Line Factbox
and Subc. Transfer Line Factbox benefit from this single-point fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ChethanT ChethanT requested a review from a team as a code owner May 13, 2026 14:32
@ChethanT ChethanT requested a review from m4rusu May 13, 2026 14:32
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label May 13, 2026
@github-actions github-actions Bot modified the milestone: Version 29.0 May 13, 2026
@ChethanT ChethanT removed the request for review from m4rusu May 13, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant