---
id: object/codeunit/20441
type: object
title: Codeunit 20441 "Qlty. Disp. Purchase Return"
summary: Codeunit 20441 "Qlty. Disp. Purchase Return" in Quality Management (Microsoft.QualityManagement.Dispositions.Purchase). 3 public procedures, 4 events. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - quality management
versions:
  introduced: "29"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: b80911d4b0e20e8bf112e3f64462d7c61217d6844a201faf8ad20ef621ebf251
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/Quality%20Management/app/src/Dispositions/Purchase/QltyDispPurchaseReturn.Codeunit.al
    title: src/Apps/W1/Quality Management/app/src/Dispositions/Purchase/QltyDispPurchaseReturn.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10270
object_type: codeunit
object_id: 20441
name: Qlty. Disp. Purchase Return
namespace: Microsoft.QualityManagement.Dispositions.Purchase
app: Quality Management
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 10
  events: 4
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 4
  called_by: 1
  implements: 1
---

# Codeunit 20441 "Qlty. Disp. Purchase Return"

> Codeunit 20441 "Qlty. Disp. Purchase Return" in Quality Management (Microsoft.QualityManagement.Dispositions.Purchase). 3 public procedures, 4 events. Introduced in BC29, still in BC30.

Quality Management · Microsoft.QualityManagement.Dispositions.Purchase · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/Quality%20Management/app/src/Dispositions/Purchase/QltyDispPurchaseReturn.Codeunit.al) · facts from BC29

## Events published

- `OnBeforeProcessDisposition(var QltyInspectionHeader: Record "Qlty. Inspection Header"; var TempInstructionQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary; var DidSomething: Boolean; var IsHandled: Boolean)` (integration): Provides an opportunity to modify the create Purchase Return Order behavior or replace it completely.
- `OnAfterProcessDisposition(var QltyInspectionHeader: Record "Qlty. Inspection Header"; var TempInstructionQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary; var CreatedReturnOrderPurchaseHeader: Record "Purchase Header"; var DidSomething: Boolean)` (integration): Occurs after the purchase return order and its lines are processed.
- `OnBeforeCreateOrUpdatePurchaseReturnOrderLine(var QltyInspectionHeader: Record "Qlty. Inspection Header"; var TempQuantityToActQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary; var PurchRcptLine: Record "Purch. Rcpt. Line"; var ReturnOrderPurchaseHeader: Record "Purchase Header"; var ReturnOrderPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration): Occurs before a purchase return order line is created or updated and can replace the default handling.
- `OnAfterCreateOrUpdatePurchaseReturnOrderLine(var QltyInspectionHeader: Record "Qlty. Inspection Header"; var TempQuantityToActQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary; var PurchRcptLine: Record "Purch. Rcpt. Line"; var ReturnOrderPurchaseHeader: Record "Purchase Header"; var ReturnOrderPurchaseLine: Record "Purchase Line")` (integration): Occurs after a purchase return order line is created or updated.

## Procedures

- `PerformDisposition(var QltyInspectionHeader: Record "Qlty. Inspection Header"; QltyQuantityBehavior: Enum "Qlty. Quantity Behavior"; OptionalSpecificQuantity: Decimal; OptionalSourceLocationFilter: Text; OptionalSourceBinFilter: Text; ReasonCode: Code[10]; ExternalDocumentNo: Code[35]): Boolean` (internal): Creates a purchase return order from a quality inspection and explicit disposition options.
- `PerformDisposition(var QltyInspectionHeader: Record "Qlty. Inspection Header"; var TempInstructionQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary): Boolean`: Creates a purchase return order and return lines for the inspection inventory.
- `GetCreatedPurchaseReturnBuffer(var TempCreatedBufferPurchaseHeader2: Record "Purchase Header" temporary)` (internal): Gets the created purchase return headers that were created as buffer tables.

Plus 3 local procedures.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 5402 "Unit of Measure Management"](../codeunit/5402.md) (3 calls: `CreatePurchaseReturnOrderLine → CalcQtyFromBase`, `CreatePurchaseReturnOrderLine → GetQtyPerUnitOfMeasure`, `FindPurchaseReceiptLineForInspection → CalcBaseQty`)
- [Codeunit 6620 "Copy Document Mgt."](../codeunit/6620.md) (2 calls: `CreatePurchaseReturnOrderLine → CopyPurchRcptLinesToDoc`, `CreatePurchaseReturnOrderLine → SetHideProcessWindow`)
- [Codeunit 20439 "Qlty. Item Tracking Mgmt."](../codeunit/20439.md) (1 call: `CreatePurchaseReturnOrderLine → DeleteAndRecreatePurchaseReturnOrderLineTracking`)
- [Codeunit 6503 "Item Tracking Doc. Management"](../codeunit/6503.md) (1 call: `FindPurchaseReceiptLineForInspection → RetrieveEntriesFromShptRcpt`)

## Called by

- [Codeunit 20424 "Qlty. Workflow Response"](../codeunit/20424.md) (1 call: `HandleOnExecuteWorkflowResponse → PerformDisposition`)

## Implements

- [Interface "Qlty. Disposition"](../interface/qlty-disposition.md)

## Recent changes

- 2026-08-20 [#10270 [Quality Management] Repair and improve XML documentation of procedures](../../changes/bcapps/10270.md) (main, BC30, refactor)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Qlty. Disp. Purchase Return")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
