[Subcontracting] Bug 640115: Fix Subc. Order FlowField so subcontracting orders are visible in Purchase Order List#8757
Open
ChethanT wants to merge 10 commits into
Open
[Subcontracting] Bug 640115: Fix Subc. Order FlowField so subcontracting orders are visible in Purchase Order List#8757ChethanT wants to merge 10 commits into
ChethanT wants to merge 10 commits into
Conversation
The 'Subc. Order' FlowField on Purchase Header was checking base table fields 'Prod. Order No.' and 'Prod. Order Line No.' on Purchase Line. These fields are not reliably populated by the Subcontracting app's purchase order creation flow. Changed the CalcFormula to use 'Subc. Purchase Line Type' = filter(<> None), which is the extension field that the Subcontracting app reliably sets and is already used by the Manufacturing Cue for counting subcontracting lines. Added test SubcOrderFlowFieldIsTrueAfterCreatingSubcontractingPurchaseOrder to verify the FlowField evaluates correctly. Fixes AB#640115 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…40115-subc-order-flowfield-fix
WorkCenter.'Unit of Measure Code' is a capacity UOM that doesn't exist in the Unit of Measure table. Create the item first, then use its Base Unit of Measure for the Production BOM Header. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The test was trying to locate a Prod. Order Routing Line directly, but the existing helper already encapsulates the correct Type = Work Center filter and purchase order creation flow. Reuse it so the test targets the actual subcontracting scenario instead of depending on an incomplete lookup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…40115-subc-order-flowfield-fix
Contributor
Copilot PR ReviewIteration 6 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
Use SubcWarehouseLibrary.CreateSubcontractingOrderFromProdOrderRouting, which exists on this branch, instead of a non-existent call on SubcontractingMgmtLibrary. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Select the released Prod. Order Routing Line by production order and work center before invoking CreateSubcontracting. This avoids relying on a routing-no-based lookup that can miss the generated routing line. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AleksandricMarko
previously approved these changes
Jun 25, 2026
PredragMaricic
previously approved these changes
Jun 25, 2026
…40115-subc-order-flowfield-fix
ChethanT
added a commit
that referenced
this pull request
Jun 26, 2026
Backport of #8757 to releases/28.x. Cherry-picked from commit 63cfaf5 (Bug 640115: Fix Subc. Order FlowField to use Subc. Purchase Line Type). Fixes [AB#640115](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/640115) --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1fe00bd
alexei-dobriansky
approved these changes
Jun 26, 2026
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
Subcontracting purchase orders are not visible in the "Subcontracting Orders" view of the Purchase Order List because the
Subc. OrderFlowField always evaluates tofalse.Root Cause
The CalcFormula on the
Subc. Orderfield (field 99001521 on the Purchase Header table extension) was checking base table fieldsProd. Order No.andProd. Order Line No.on Purchase Line. These fields are not reliably populated by the Subcontracting app's own purchase order creation flow.Fix
Changed the CalcFormula to use
"Subc. Purchase Line Type" = filter(<> None), which is the extension field the Subcontracting app reliably sets. Consistent withSubcManufacturingCue.TableExt.al.Test
Added
SubcOrderFlowFieldIsTrueAfterCreatingSubcontractingPurchaseOrder(SCENARIO 640115) in codeunit 139991.Fixes AB#640115