---
id: change/bcapps/12683
type: change
title: "#12683 [API tests] Return shipment PDF selection and pdfDocument test isolation"
summary: The return shipment PDF handler now uses the P.Ret.Shpt. report selection instead of P.Return, so the API can produce a PDF for a posted return shipment. Three API pdfDocument tests are fixed by disabling test isolation and creating their own documents, and they are removed from the disabled list.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit return shpt. pdf doc.handler
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-11-05T00:53:33.585Z"
  flags: []
generated:
  at: "2026-11-06T00:17:27.413Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 325ec2a89f95aa57c652d8ebc91292611936629a
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12683
    title: "microsoft/BCApps#12683: [API tests] Return shipment PDF selection and pdfDocument test isolation"
    date: "2026-11-04"
    commit: 325ec2a89f95aa57c652d8ebc91292611936629a
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/4999
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-test-codeunits-and-test-methods
      title: Test Codeunits and Test Methods in AL
      label: possibly related
      why: Documents test codeunits and test methods including handler methods for automated testing.
      by: model
number: 12683
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12683
kind: pr
base_branch: main
major: "30"
merged_at: "2026-11-04T13:42:00Z"
author: t-prda
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 5
  additions: 14
  deletions: 28
  al: 1
apps:
  - Base Application
objects_touched:
  - key: codeunit/4999
    page: codeunit/4999
    type: codeunit
    id: 4999
    name: Return Shpt. PDF Doc.Handler
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 646383
  - 653393
  - 657798
systems:
  - integration
quote: null
joined_against:
  major: "30"
  commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
---

# #12683 [API tests] Return shipment PDF selection and pdfDocument test isolation

> The return shipment PDF handler now uses the P.Ret.Shpt. report selection instead of P.Return, so the API can produce a PDF for a posted return shipment. Three API pdfDocument tests are fixed by disabling test isolation and creating their own documents, and they are removed from the disabled list.

[Pull request](https://github.com/microsoft/BCApps/pull/12683) · merged into `main` (BC30) on 2026-11-04 by t-prda · 5 files (+14 -28), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Return Shpt. PDF Doc.Handler uses P.Ret.Shpt. instead of P.Return report selection usage
- Before this fix, expanding pdfDocument on purchase return shipments returned HTTP 400
- RequiredTestIsolation set to Disabled on the three API test codeunits so data is committed before the HTTP call
- Blanket order and quote tests create their own one-line document
- Three tests removed from the APIV2 disabled-tests list
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 4999 "Return Shpt. PDF Doc.Handler"](../../objects/codeunit/4999.md), Base Application: modified

## Context

- Work items: AB#646383, AB#653393, AB#657798
- Labels: AL: Apps (W1), Team: SCM
- Systems: integration

## Possibly related

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

- [Test Codeunits and Test Methods in AL](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-test-codeunits-and-test-methods) — possibly related: Documents test codeunits and test methods including handler methods for automated testing. (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).
