---
id: change/bcapps/9087
type: change
title: "#9087 Bug 641331: Copy Production Order Document lookup shows the current document"
summary: The Copy Production Order Document report now excludes the current production order from the document lookup when searching for a source document, preventing a late error when the same order is selected.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - report copy production order document
system: manufacturing
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:09:39.068Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 49a9571fc8b85603359b60e43894b7d8515c9fe6
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9087
    title: "microsoft/BCApps#9087: Bug 641331: Copy Production Order Document lookup shows the current document"
    date: "2026-08-12"
    commit: 49a9571fc8b85603359b60e43894b7d8515c9fe6
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/report/99003802
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9087
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9087
kind: pr
base_branch: main
major: "30"
merged_at: "2026-08-12T14:01:10Z"
author: alexei-dobriansky
author_type: User
community_contribution: false
labels:
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 1
  additions: 3
  deletions: 0
  al: 1
apps:
  - Base Application
objects_touched:
  - key: report/99003802
    page: report/99003802
    type: report
    id: 99003802
    name: Copy Production Order Document
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 641331
systems:
  - manufacturing
quote: null
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #9087 Bug 641331: Copy Production Order Document lookup shows the current document

> The Copy Production Order Document report now excludes the current production order from the document lookup when searching for a source document, preventing a late error when the same order is selected.

[Pull request](https://github.com/microsoft/BCApps/pull/9087) · merged into `main` (BC30) on 2026-08-12 by alexei-dobriansky · 1 file (+3 -0), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Document lookup in LookupDocNo() now filters out the target production order
- Filter only applies when the source status matches the target status
- Prevents users from selecting the same document as the source, avoiding late-stage error
- Aligns behavior with Copy Sales/Purchase Document reports
- Behaviour changes for users or extensions.

## AL objects touched

- [Report 99003802 "Copy Production Order Document"](../../objects/report/99003802.md), Base Application: modified

## Context

- Work items: AB#641331
- Labels: Team: SCM
- Systems: manufacturing

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).
