---
id: change/bcapps/8902
type: change
title: "#8902 Bug 639568: Scope Subc. PO component location check to current prod order line"
summary: Fixed a false warning when creating subcontracting purchase orders from routing lines on production orders with multiple lines sharing the same routing link code by scoping the component location check to the current line.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit subc. purchase order creator
system: manufacturing
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:11:08.687Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 7b29c0b65f7b9cf7d113119e949e34c42cbadf3a
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/8902
    title: "microsoft/BCApps#8902: Bug 639568: Scope Subc. PO component location check to current prod order line"
    date: "2026-07-28"
    commit: 7b29c0b65f7b9cf7d113119e949e34c42cbadf3a
    t: null
    quote: added `SetRange("Prod. Order Line No.", ProdOrderRoutingLine."Routing Reference No.")` to scope the check to the line being processed
links:
  learn: []
  objects:
    - object/codeunit/20557
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 8902
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/8902
kind: pr
base_branch: main
major: "30"
merged_at: "2026-07-28T11:32:34Z"
author: ChethanT
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - Subcontracting
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 79
  deletions: 0
  al: 1
apps:
  - Subcontracting
objects_touched:
  - key: codeunit/20557
    page: codeunit/20557
    type: codeunit
    id: 20557
    name: Subc. Purchase Order Creator
    app: Subcontracting
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 639568
systems:
  - manufacturing
quote: added `SetRange("Prod. Order Line No.", ProdOrderRoutingLine."Routing Reference No.")` to scope the check to the line being processed
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #8902 Bug 639568: Scope Subc. PO component location check to current prod order line

> Fixed a false warning when creating subcontracting purchase orders from routing lines on production orders with multiple lines sharing the same routing link code by scoping the component location check to the current line.

[Pull request](https://github.com/microsoft/BCApps/pull/8902) · merged into `main` (BC30) on 2026-07-28 by ChethanT · 2 files (+79 -0), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- A false warning about component location appeared when a production order had several lines sharing the same routing link code
- Root cause: the component check filtered by production order and routing link code but not by production order line number
- Adds a Prod. Order Line No. filter so only the current line's components are checked
- Adds a test where another line's component is already at the subcontracting location
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 20557 "Subc. Purchase Order Creator"](../../objects/codeunit/20557.md), Subcontracting: modified

## Context

- Work items: AB#639568
- Labels: AL: Apps (W1), Subcontracting, Team: SCM
- Systems: manufacturing
- From the description: "added `SetRange("Prod. Order Line No.", ProdOrderRoutingLine."Routing Reference No.")` to scope the check to the line being processed"

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
