Skip to content

(Bug 633226): [Subcontracting] Standard Task not propagated from Routing to Prod. Order Routing or Subcontracting Worksheet; prices not picked up#8253

Open
alexei-dobriansky wants to merge 8 commits into
mainfrom
bugs/633226-Subcon_StandardTaskInRoutingNotHandled
Open

(Bug 633226): [Subcontracting] Standard Task not propagated from Routing to Prod. Order Routing or Subcontracting Worksheet; prices not picked up#8253
alexei-dobriansky wants to merge 8 commits into
mainfrom
bugs/633226-Subcon_StandardTaskInRoutingNotHandled

Conversation

@alexei-dobriansky
Copy link
Copy Markdown
Contributor

@alexei-dobriansky alexei-dobriansky commented May 20, 2026

Summary

The Subcontracting Worksheet flow was dropping Standard Task Code between the Prod. Order Routing Line and the Requisition Line, the field on the worksheet was read-only, and Subcontractor Prices keyed on a Standard Task were therefore never applied. This change:

  • Propagates Standard Task Code from Prod. Order Routing Line to Requisition Line in both worksheet-population paths (Calculate Subcontracts… on the worksheet, and direct PO creation from a Prod. Order Routing line).
  • Makes the Standard Task Code field editable on the Subcontracting Worksheet so users can override it.
  • Causes the standard-task-bound subcontractor price to flow through to the Subcontracting Purchase Order's Direct Unit Cost.

The bug enumerated four symptoms (Routing → Prod. Order Routing, Prod. Order Routing → Worksheet, field not editable, prices not picked up). Routing → Prod. Order Routing was already handled by Prod. Order Routing Line.CopyFromRoutingLine; no change there. The remaining three are addressed below.

Changes

SubcCalcSubcontractsExt.Codeunit.al

Extended the existing OnAfterTransferProdOrderRoutingLine subscriber on report Subc. Calculate Subcontracts to also Validate("Standard Task Code", ProdOrderRoutingLine."Standard Task Code") on the new requisition line. Using Validate (not direct assignment) fires the field's OnValidate trigger in Subc. RequisitionLine, which calls UpdateSubcontractorPriceSubc. Price Management.GetSubcPriceForReqLine. The price lookup already filters Subcontractor Price by RequisitionLine."Standard Task Code" exactly, so the standard-task-bound price is applied immediately.

SubcPurchaseOrderCreator.Codeunit.al

Same fix in InsertReqWkshLine, which is the alternate worksheet-line builder used when a Subcontracting PO is created directly from a Prod. Order Routing Line (bypassing the worksheet UI).

SubcSubcontractingWorksheet.Page.al

Removed Editable = false from the Standard Task Code field and added a tooltip clarifying that editing the value re-applies the matching subcontractor price. The field's OnValidate already triggers price re-lookup, so manual edits/clears on the worksheet immediately update Direct Unit Cost.

Fixes AB#633226

@alexei-dobriansky alexei-dobriansky self-assigned this May 20, 2026
@alexei-dobriansky alexei-dobriansky requested a review from a team as a code owner May 20, 2026 16:06
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Accessibility} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

Editable field missing ToolTip property

Removing Editable = false makes "Subc. Standard Task Code" user-editable, but no ToolTip was added to guide users on the field's purpose or expected values. Neighbouring fields on this page have tooltips; the pattern should be consistent.

Recommendation:

  • Add a ToolTip property to explain what the field controls and how editing it affects subcontractor price lookup.
                field("Subc. Standard Task Code"; Rec."Subc. Standard Task Code")
                {
                    ApplicationArea = Manufacturing;
                    ToolTip = 'Specifies the standard task code for the subcontracting operation. Changing this value re-applies the matching subcontractor price.';
                }

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

@github-actions
Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Style} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

Missing newline at end of file

The file does not end with a newline character (\ No newline at end of file), which is flagged by most linters and can cause noisy diffs in future edits.

Recommendation:

  • Add a trailing newline after the closing } of the codeunit.
    end;
}

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

@github-actions github-actions Bot added this to the Version 29.0 milestone May 20, 2026
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.

3 participants