Skip to content

[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
mainfrom
bug/640115-subc-order-flowfield-fix
Open

[Subcontracting] Bug 640115: Fix Subc. Order FlowField so subcontracting orders are visible in Purchase Order List#8757
ChethanT wants to merge 10 commits into
mainfrom
bug/640115-subc-order-flowfield-fix

Conversation

@ChethanT

@ChethanT ChethanT commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Subcontracting purchase orders are not visible in the "Subcontracting Orders" view of the Purchase Order List because the Subc. Order FlowField always evaluates to false.

Root Cause

The CalcFormula on the Subc. Order field (field 99001521 on the Purchase Header table extension) 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 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 with SubcManufacturingCue.TableExt.al.

Test

Added SubcOrderFlowFieldIsTrueAfterCreatingSubcontractingPurchaseOrder (SCENARIO 640115) in codeunit 139991.

Fixes AB#640115

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>
@ChethanT ChethanT requested a review from a team June 23, 2026 19:44
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jun 23, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jun 23, 2026
ChethanT and others added 2 commits June 23, 2026 23:26
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>
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 6 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

ChethanT and others added 3 commits June 24, 2026 15:45
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>
@ChethanT ChethanT enabled auto-merge (squash) June 24, 2026 21:40
@ChethanT ChethanT changed the title Bug 640115: Fix Subc. Order FlowField so subcontracting orders are visible in Purchase Order List [Subcontracting] Bug 640115: Fix Subc. Order FlowField so subcontracting orders are visible in Purchase Order List Jun 25, 2026
@ChethanT ChethanT added the Subcontracting Subcontracting related activities label Jun 25, 2026
PredragMaricic
PredragMaricic previously approved these changes Jun 25, 2026
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>
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 Subcontracting Subcontracting related activities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants