[Subcontracting] Bug 640115: Fix Subc. Order FlowField so subcontracting orders are visible in Purchase Order List#8757
[Subcontracting] Bug 640115: Fix Subc. Order FlowField so subcontracting orders are visible in Purchase Order List#8757ChethanT 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
Copilot PR ReviewIteration 7 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 1 knowledge-backed · 0 agent findings. 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>
…40115-subc-order-flowfield-fix
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
| ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified); | ||
| ProductionBOMHeader.Modify(true); | ||
| FinishedItem.Validate("Production BOM No.", ProductionBOMHeader."No."); | ||
| FinishedITem.Validate("Routing No.", RoutingHeader."No."); |
There was a problem hiding this comment.
Variable 'FinishedItem' is referenced as 'FinishedITem' (capital I and T) on line 844, inconsistent with its declaration on line 801.
AL identifiers are case-insensitive so this compiles and runs correctly, but the casing typo reduces readability.
Recommendation:
- correct the casing to 'FinishedItem' to match the declaration.
| FinishedITem.Validate("Routing No.", RoutingHeader."No."); | |
| FinishedItem.Validate("Routing No.", RoutingHeader."No."); |
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
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