---
id: object/codeunit/415
type: object
title: Codeunit 415 "Release Purchase Document"
summary: Codeunit 415 "Release Purchase Document" in Base Application (Microsoft.Purchases.Document). 8 public procedures, 26 events. Present since at least BC23, still in BC30, changed in BC25, BC28.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "28"
  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: 571be51fe32876c3ef41dcd4144c9ba1eabd14ae8771452a540255ea0c3571da
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Purchases/Document/ReleasePurchaseDocument.Codeunit.al
    title: src/Layers/W1/BaseApp/Purchases/Document/ReleasePurchaseDocument.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/ru
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 415
name: Release Purchase Document
namespace: Microsoft.Purchases.Document
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "25"
  - "28"
source_major: "29"
obsolete: null
countries:
  - ru
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 39
  events: 26
  subscribers: 0
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 7
  calls: 4
  called_by: 15
  implements: 0
---

# Codeunit 415 "Release Purchase Document"

> Codeunit 415 "Release Purchase Document" in Base Application (Microsoft.Purchases.Document). 8 public procedures, 26 events. Present since at least BC23, still in BC30, changed in BC25, BC28.

Base Application · Microsoft.Purchases.Document · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Purchases/Document/ReleasePurchaseDocument.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| TableNo | Purchase Header |
| Permissions | TableData "Purchase Header" = rm, TableData "Purchase Line" = r |

## Events published

- `OnBeforeCalcInvDiscount(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean; var LinesWereModified: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeCheckPurchaseHeaderPendingApproval(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)` (integration)
- `OnBeforeCheckReopenStatus(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)` (integration)
- `OnBeforeManualReleasePurchaseDoc(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean)` (integration)
- `OnBeforePerformManualCheckAndRelease(var PurchHeader: Record "Purchase Header"; PreviewMode: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeReleasePurchaseDoc(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean; var SkipCheckReleaseRestrictions: Boolean; var IsHandled: Boolean; SkipWhseRequestOperations: Boolean)` (integration)
  - subscribers: [Codeunit 6103 "E-Document Subscribers"](../codeunit/6103.md) OnBeforeReleasePurchaseDoc
- `OnAfterReleasePurchaseDoc(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean; var LinesWereModified: Boolean; SkipWhseRequestOperations: Boolean)` (integration)
  - subscribers: [Codeunit 1520 "Workflow Event Handling"](../codeunit/1520.md) RunWorkflowOnAfterReleasePurchaseDoc, [Codeunit 20411 "Qlty. Receiving Integration"](../codeunit/20411.md) HandleOnAfterReleasePurchDoc, [Codeunit 38505 "Purchases External Events"](../codeunit/38505.md) OnAfterReleasePurchaseDoc, [Codeunit 6103 "E-Document Subscribers"](../codeunit/6103.md) OnAfterReleasePurchaseDoc
- `OnAfterManualReleasePurchaseDoc(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean)` (integration)
- `OnBeforeManualReopenPurchaseDoc(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean)` (integration)
- `OnBeforeReopenPurchaseDoc(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean; var IsHandled: Boolean; SkipWhseRequestOperations: Boolean)` (integration)
- `OnBeforeModifyPurchDoc(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforePerformManualRelease(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeCheckPurchLines(var PurchaseHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnAfterReopenPurchaseDoc(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean; SkipWhseRequestOperations: Boolean)` (integration)
- `OnAfterManualReopenPurchaseDoc(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean)` (integration)
- `OnCodeOnAfterCheck(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var LinesWereModified: Boolean)` (integration)
  - subscribers: [Codeunit 5012 "Service Declaration Mgt."](../codeunit/5012.md) OnReleasePurchDoc
- `OnCodeOnAfterPurchLineSetFilters(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
  - subscribers: [Codeunit 8066 "Purchase Documents"](../codeunit/8066.md) SkipQuantityCheckForSubscriptionBillingOnCodeOnAfterPurchLineSetFilters
- `OnCodeOnBeforeModifyHeader(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; PreviewMode: Boolean; var LinesWereModified: Boolean; var NotOnlyDropShipment: Boolean)` (integration)
- `OnCodeOnCheckTracking(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line")` (integration)
- `OnPerformManualReleaseOnBeforeTestPurchasePrepayment(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean)` (integration)
- `OnCodeOnAfterCheckPurchaseReleaseRestrictions(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)` (integration)
- `OnCodeOnBeforeCalcAndUpdateVATOnLines(var PurchaseHeader: Record "Purchase Header")` (integration)
- `OnCodeOnCheckPurchLineLocationCode(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeMandatoryFields(PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)` (integration)
- `OnReopenOnBeforePurchaseHeaderModify(var PurchaseHeader: Record "Purchase Header")` (integration)
- `OnAfterPerformManualCheckAndRelease(var PurchaseHeader: Record "Purchase Header")` (integration)

## Procedures

- `Reopen(var PurchHeader: Record "Purchase Header")`
- `PerformManualRelease(var PurchHeader: Record "Purchase Header")`
- `PerformManualCheckAndRelease(var PurchHeader: Record "Purchase Header")`
- `PerformManualReopen(var PurchHeader: Record "Purchase Header")`
- `ReleasePurchaseHeader(var PurchHdr: Record "Purchase Header"; Preview: Boolean): Boolean`
- `CalcAndUpdateVATOnLines(var PurchaseHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"): Boolean`
- `SetSkipCheckReleaseRestrictions()`
- `SetSkipWhseRequestOperations(NewSkipWhseRequestOperations: Boolean)` (internal)

Plus 5 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 38 "Purchase Header"](../table/38.md)

## 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 441 "Prepayment Mgt."](../codeunit/441.md) (3 calls: `Code → TestPurchasePrepayment`, `PerformManualCheckAndRelease → TestPurchasePayment`, `PerformManualRelease → TestPurchasePrepayment`)
- [Codeunit 5772 "Whse.-Purch. Release"](../codeunit/5772.md) (2 calls: `Code → Release`, `Reopen → Reopen`)
- [Codeunit 1535 "Approvals Mgmt."](../codeunit/1535.md) (1 call: `CheckPurchaseHeaderPendingApproval → IsPurchaseHeaderPendingApproval`)
- [Codeunit 70 "Purch.-Calc.Discount"](../codeunit/70.md) (1 call: `Code → (object)`)

## Called by

- [Codeunit 5747 "Purch. Whse. Post Shipment"](../codeunit/5747.md) (4 calls: `OnInitSourceDocumentHeader → (object)`, `OnInitSourceDocumentHeader → Reopen`, `OnInitSourceDocumentHeader → SetSkipCheckReleaseRestrictions`, …)
- [Codeunit 5760 "Whse.-Post Receipt"](../codeunit/5760.md) (4 calls: `InitSourceDocumentHeader → ReleasePurchaseHeader`, `InitSourceDocumentHeader → Reopen`, `InitSourceDocumentHeader → SetSkipCheckReleaseRestrictions`, …)
- [Codeunit 7324 "Whse.-Activity-Post"](../codeunit/7324.md) (4 calls: `ReleasePurchDocument → (object)`, `ReleasePurchDocument → Reopen`, `ReleasePurchDocument → SetSkipCheckReleaseRestrictions`, …)
- [Codeunit 80 "Sales-Post"](../codeunit/80.md) (4 calls: `CheckAndUpdateAssocOrderPostingDate → (object)`, `CheckAndUpdateAssocOrderPostingDate → Reopen`, `CheckAndUpdateAssocOrderPostingDate → SetSkipCheckReleaseRestrictions`, …)
- [Codeunit 2679 "Purchase Alloc. Acc. Mgt."](../codeunit/2679.md) (3 calls: `CheckPurchaseReleaseStatus → (object)`, `CheckPurchaseReleaseStatus → Reopen`, `CheckPurchaseReleaseStatus → SetSkipCheckReleaseRestrictions`)
- [Codeunit 1521 "Workflow Response Handling"](../codeunit/1521.md) (2 calls: `OpenDocument → Reopen`, `ReleaseDocument → PerformManualCheckAndRelease`)
- [Codeunit 1372 "Purchase Batch Post Mgt."](../codeunit/1372.md) (1 call: `ReleasePurchaseHeader → (object)`)
- [Codeunit 4142 "Purchase Manual Release"](../codeunit/4142.md) (1 call: `OnRun → PerformManualRelease`)
- [Codeunit 4144 "Purchase Manual Reopen"](../codeunit/4144.md) (1 call: `OnRun → PerformManualReopen`)
- [Codeunit 427 "ICInboxOutboxMgt"](../codeunit/427.md) (1 call: `SendPurchDoc → (object)`)
- [Codeunit 441 "Prepayment Mgt."](../codeunit/441.md) (1 call: `UpdatePendingPrepaymentPurchase → (object)`)
- [Codeunit 90 "Purch.-Post"](../codeunit/90.md) (1 call: `ReleasePurchDocument → ReleasePurchaseHeader`)
- [Codeunit 98 "Purchase Post via Job Queue"](../codeunit/98.md) (1 call: `EnqueuePurchDocWithUI → (object)`)
- [Page 403 "Purchase Order Statistics"](../page/403.md) (1 call: `OnQueryClosePage → CalcAndUpdateVATOnLines`)
- [Table 130 "Incoming Document"](../table/130.md) (1 call: `CreateReleasedDocumentWithDataExchange → PerformManualRelease`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC25, BC28

## Countries that replace it

[RU](../../localizations/ru.md)

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: "Release Purchase Document")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
