---
id: change/bcapps/12554
type: change
title: '#12554 [Main] - User encounters a "record is not open" error when attaching a document to a posted sales shipment in Dynamics 365 (Base Application v28)'
summary: Document attachment uploads now work correctly for posted sales shipments and return receipts by adding missing table references and hardening error handling.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit e-doc. attachment processor
  - codeunit expense attachment mgt.
  - codeunit sub. contracts general mgt.
  - page doc. attachment list factbox
  - codeunit document attachment mgmt
  - codeunit prod. document attachment mgt.
system: platform
review:
  state: reviewed
  by: opus
  at: "2026-10-16T01:17:14.488Z"
  flags: []
generated:
  at: "2026-11-12T00:14:43.393Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 070e66c3cba2ef12db782e8857b43f9035892bc7
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12554
    title: 'microsoft/BCApps#12554: [Main] - User encounters a "record is not open" error when attaching a document to a posted sales shipment in Dynamics 365 (Base Application v28)'
    date: "2026-10-13"
    commit: 070e66c3cba2ef12db782e8857b43f9035892bc7
    t: null
    quote: Added the missing Database::Sales Shipment Header and Database::Return Receipt Header cases to GetRefTable, each opening the RecordRef on its table.
links:
  learn: []
  objects:
    - object/codeunit/6169
    - object/codeunit/6989
    - object/codeunit/8059
    - object/page/1178
    - object/codeunit/1173
    - object/codeunit/99000783
    - object/codeunit/6459
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/across-how-connect-disconnect-income-document-records
      title: Create Incoming Document Records Directly from Documents and Entries
      label: possibly related
      why: Covers attaching documents to posted sales and purchase records including shipments.
      by: model
number: 12554
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12554
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-13T10:29:57Z"
author: DhavalMore88
author_type: User
community_contribution: true
labels:
  - "ADO: Sync"
  - "AL: Apps (W1)"
  - From Fork
  - "Ownership: Needs Review"
  - "Team: Other"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 9
  additions: 732
  deletions: 151
  al: 7
apps:
  - Base Application
  - EDocument
  - ExpenseAgent
  - Subscription Billing
objects_touched:
  - key: codeunit/6169
    page: codeunit/6169
    type: codeunit
    id: 6169
    name: E-Doc. Attachment Processor
    app: EDocument
    status: modified
  - key: codeunit/6989
    page: codeunit/6989
    type: codeunit
    id: 6989
    name: Expense Attachment Mgt.
    app: ExpenseAgent
    status: modified
  - key: codeunit/8059
    page: codeunit/8059
    type: codeunit
    id: 8059
    name: Sub. Contracts General Mgt.
    app: Subscription Billing
    status: modified
  - key: page/1178
    page: page/1178
    type: page
    id: 1178
    name: Doc. Attachment List Factbox
    app: Base Application
    status: modified
  - key: codeunit/1173
    page: codeunit/1173
    type: codeunit
    id: 1173
    name: Document Attachment Mgmt
    app: Base Application
    status: modified
  - key: codeunit/99000783
    page: codeunit/99000783
    type: codeunit
    id: 99000783
    name: Prod. Document Attachment Mgt.
    app: Base Application
    status: modified
  - key: codeunit/6459
    page: codeunit/6459
    type: codeunit
    id: 6459
    name: Serv. Document Attachment Mgt.
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports:
  - number: 12815
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/12815
fixes_issues: []
work_items:
  - 646549
systems:
  - platform
  - copilot
  - integration
  - manufacturing
  - sales
  - service
quote: Added the missing Database::Sales Shipment Header and Database::Return Receipt Header cases to GetRefTable, each opening the RecordRef on its table.
joined_against:
  major: "30"
  commit: f18567dc08e2bd162bf192e1da4d714b57eb099f
---

# #12554 [Main] - User encounters a "record is not open" error when attaching a document to a posted sales shipment in Dynamics 365 (Base Application v28)

> Document attachment uploads now work correctly for posted sales shipments and return receipts by adding missing table references and hardening error handling.

[Pull request](https://github.com/microsoft/BCApps/pull/12554) · merged into `main` (BC30) on 2026-10-13 by DhavalMore88 (community contribution) · 9 files (+732 -151), 7 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Added Sales Shipment Header and Return Receipt Header cases to GetRefTable in Document Attachment Mgmt
- Uploading files from the Documents FactBox on posted sales shipments and return receipts no longer fails with 'The record is not open'
- Upload files, Show details and Attach from email in the FactBox now raise a clear error if the source record still cannot be resolved after OnAfterGetRecRefFail
- Follows the existing pattern used for Sales Invoice Header and Sales Cr.Memo Header
- Regression tests added in W1 and ES test layers
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 6169 "E-Doc. Attachment Processor"](../../objects/codeunit/6169.md), EDocument: modified
- [Codeunit 6989 "Expense Attachment Mgt."](../../objects/codeunit/6989.md), ExpenseAgent: modified
- [Codeunit 8059 "Sub. Contracts General Mgt."](../../objects/codeunit/8059.md), Subscription Billing: modified
- [Page 1178 "Doc. Attachment List Factbox"](../../objects/page/1178.md), Base Application: modified
- [Codeunit 1173 "Document Attachment Mgmt"](../../objects/codeunit/1173.md), Base Application: modified
- [Codeunit 99000783 "Prod. Document Attachment Mgt."](../../objects/codeunit/99000783.md), Base Application: modified
- [Codeunit 6459 "Serv. Document Attachment Mgt."](../../objects/codeunit/6459.md), Base Application: modified

## Also merged into

- [#12815](https://github.com/microsoft/BCApps/pull/12815) into `releases/29.x` on 2026-11-03

## Context

- Work items: AB#646549
- Labels: ADO: Sync, AL: Apps (W1), From Fork, Ownership: Needs Review, Team: Other
- Systems: platform, copilot, integration, manufacturing, sales, service
- From the description: "Added the missing Database::Sales Shipment Header and Database::Return Receipt Header cases to GetRefTable, each opening the RecordRef on its table."

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Create Incoming Document Records Directly from Documents and Entries](https://learn.microsoft.com/dynamics365/business-central/across-how-connect-disconnect-income-document-records) — possibly related: Covers attaching documents to posted sales and purchase records including shipments. (model-linked)

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