---
id: object/codeunit/5579
type: object
title: Codeunit 5579 "Digital Voucher Impl."
summary: Codeunit 5579 "Digital Voucher Impl." in EnforcedDigitalVouchers (Microsoft.EServices.EDocument). 10 public procedures, 2 events, 23 event subscribers. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - enforceddigitalvouchers
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: db0fb45ba18b399562b3fb1ad9040fe7caa59506563bd31b37d3561c5509e7df
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al
    title: src/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.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/9208
object_type: codeunit
object_id: 5579
name: Digital Voucher Impl.
namespace: Microsoft.EServices.EDocument
app: EnforcedDigitalVouchers
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: 50
  events: 2
  subscribers: 23
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 8
  called_by: 4
  implements: 0
---

# Codeunit 5579 "Digital Voucher Impl."

> Codeunit 5579 "Digital Voucher Impl." in EnforcedDigitalVouchers (Microsoft.EServices.EDocument). 10 public procedures, 2 events, 23 event subscribers. Introduced in BC29, still in BC30.

EnforcedDigitalVouchers · Microsoft.EServices.EDocument · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | TableData "Sales Invoice Header" = m, Tabledata "Sales Cr.Memo Header" = m, Tabledata "Service Invoice Header" = m, Tabledata "Service Cr.Memo Header" = m, Tabledata "Purch. Inv. Header" = m, Tabledata "Purch. Cr. Memo Hdr." = m |

## Events published

- `OnGenerateDigitalVoucherForDocumentOnCaseElse(RecRef: RecordRef)` (integration)
- `OnHandleDigitalVoucherEntrySetupWhenEnforced(EntryType: Enum "Digital Voucher Entry Type")` (internal)

## Event subscriptions

- InsertIntoAssistedSetup subscribes to Codeunit "Guided Experience" OnRegisterAssistedSetup
- OnAfterCheckSalesDoc subscribes to Codeunit "Sales-Post" OnAfterCheckSalesDoc
- OnInitializeOnAfterCheckAndSetPostingConstants subscribes to Codeunit "Service-Post" OnInitializeOnAfterCheckAndSetPostingConstants
- OnAfterCheckSalesPrepmtDoc subscribes to Codeunit "Sales-Post Prepayments" OnAfterCheckPrepmtDoc
- OnAfterCheckPurchDoc subscribes to Codeunit "Purch.-Post" OnAfterCheckPurchDoc
- OnAfterCheckPurchPrepmtDoc subscribes to Codeunit "Purchase-Post Prepayments" OnAfterCheckPrepmtDoc
- OnAfterCheckGenJnlLine subscribes to Codeunit "Gen. Jnl.-Check Line" OnAfterCheckGenJnlLine
- CheckSalesVoucherOnAfterFinalizePostingOnBeforeCommit subscribes to Codeunit "Sales-Post" OnAfterFinalizePostingOnBeforeCommit
- CheckServiceVoucherOnAfterPostServiceDoc subscribes to Codeunit "Service-Post" OnAfterPostServiceDoc
- CheckSalesVoucherOnAfterPostPrepayments subscribes to Codeunit "Sales-Post Prepayments" OnAfterPostPrepayments
- CheckPurchVoucherOnAfterFinalizePostingOnBeforeCommit subscribes to Codeunit "Purch.-Post" OnAfterFinalizePostingOnBeforeCommit
- CheckPurchVoucherOnAfterPostPrepayments subscribes to Codeunit "Purchase-Post Prepayments" OnAfterPostPrepayments
- OnProcessLinesOnAfterPostGenJnlLines subscribes to Codeunit "Gen. Jnl.-Post Batch" OnProcessLinesOnAfterPostGenJnlLines
- CheckIncomingDocumentOnBeforeDeleteEvent subscribes to Table "Incoming Document Attachment" OnBeforeDeleteEvent
- CheckVoucherOnBeforeCanReplaceMainAttachment subscribes to Table "Incoming Document" OnBeforeCanReplaceMainAttachment
- CheckVoucherOnBeforeRemoveReferencedRecords subscribes to Table "Incoming Document" OnBeforeRemoveReferencedRecords
- CheckIfChangeIsAllowedOnModifyDigitalVoucherSetup subscribes to Table "Digital Voucher Setup" OnBeforeModifyEvent
- ExcludeDigitalVouchersOnAttachIncomingDocumentsOnAfterSetFilter subscribes to Table "Email Item" OnAttachIncomingDocumentsOnAfterSetFilter
- CheckIfChangeIsAllowedOnDeleteDigitalVoucherSetup subscribes to Table "Digital Voucher Setup" OnBeforeDeleteEvent
- CopyDigitalVoucherOnAfterCreateCopyPurchDocument subscribes to Codeunit "Correct Posted Purch. Invoice" OnAfterCreateCopyDocument
- CopyDigitalVoucherOnAfterCreateCorrectiveSalesCrMemo subscribes to Codeunit "Correct Posted Sales Invoice" OnAfterCreateCorrectiveSalesCrMemo
- EDocExportOnExportEDocumentAfterCreateEDocument subscribes to Codeunit "E-Doc. Export" OnExportEDocumentAfterCreateEDocument
- EDocumentSubscribers_OnAfterUpdateToPostedPurchaseEDocument subscribes to Codeunit "E-Doc. Integration Management" OnAfterUpdateToPostedPurchaseEDocument

## Procedures

- `HandleDigitalVoucherForDocument(var ErrorMessageMgt: Codeunit "Error Message Management"; EntryType: Enum "Digital Voucher Entry Type"; Record: Variant)`
- `HandleDigitalVoucherForEntryTypeAndDoc(var ErrorMessageMgt: Codeunit "Error Message Management"; DigitalVoucherEntrySetup: Record "Digital Voucher Entry Setup"; Record: Variant)`
- `HandleDigitalVoucherForPostedDocument(EntryType: Enum "Digital Voucher Entry Type"; Record: Variant)`
- `HandleDigitalVoucherForPostedGLEntry(GLEntry: Record "G/L Entry"; GenJournalLine: Record "Gen. Journal Line"; GenJournalSourceType: Enum "Gen. Journal Source Type")`
- `GenerateDigitalVoucherForDocument(RecRef: RecordRef)`
- `AttachBlobToIncomingDocument(var TempBlob: Codeunit "Temp Blob"; DocType: Text; PostingDate: Date; DocNo: Code[20])`
- `CheckDigitalVoucherForDocument(DigitalVoucherEntryType: Enum "Digital Voucher Entry Type"; RecRef: RecordRef): Boolean`
- `CheckIncomingDocumentChange(Rec: Record "Incoming Document Attachment")`
- `GetDigitalVoucherEntrySetup(var DigitalVoucherEntrySetup: Record "Digital Voucher Entry Setup"; EntryType: Enum "Digital Voucher Entry Type"): Boolean`
- `GetIncomingDocumentRecordFromRecordRef(var IncomingDocument: Record "Incoming Document"; MainRecordRef: RecordRef): Boolean`

Plus 15 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 5585 "Digital Voucher Feature"](../codeunit/5585.md) (24 calls: `AttachIncomingEDocument → IsFeatureEnabled`, `AttachOutgoingEDocument → IsFeatureEnabled`, `CheckIfChangeIsAllowedOnDeleteDigitalVoucherSetup → CheckIfDigitalVoucherSetupChangeIsAllowed`, …)
- [Codeunit 134 "Import Attachment - Inc. Doc."](../codeunit/134.md) (5 calls: `AttachBlobToIncomingDocument → ImportAttachment`, `AttachIncomingEDocument → ImportAttachment`, `AttachPurchaseEDocument → ImportAttachment`, …)
- [Codeunit 5586 "Digital Voucher Entry"](../codeunit/5586.md) (3 calls: `AttachOutgoingEDocument → GetDocNoAndPostingDateFromRecRef`, `HandleDigitalVoucherForPostedGLEntry → GetVoucherTypeFromGLEntryOrSourceType`, `OnAfterCheckGenJnlLine → GetVoucherEntryTypeFromGenJnlLine`)
- [Codeunit 8703 "Feature Telemetry"](../codeunit/8703.md) (3 calls: `AttachIncomingEDocument → LogError`, `AttachPurchaseEDocument → LogError`, `ExtractXMLFromPDF → LogError`)
- [Codeunit 4100 "Temp Blob"](../codeunit/4100.md) (2 calls: `AttachPurchaseEDocument → HasValue`, `ExtractXMLFromPDF → HasValue`)
- [Codeunit 1990 "Guided Experience"](../codeunit/1990.md) (1 call: `InsertIntoAssistedSetup → InsertAssistedSetup`)
- [Codeunit 3110 "PDF Document"](../codeunit/3110.md) (1 call: `ExtractXMLFromPDF → GetDocumentAttachmentStream`)
- [Codeunit 701 "Data Type Management"](../codeunit/701.md) (1 call: `CheckIncomingDocumentChange → GetRecordRef`)

## Called by

- [Codeunit 5580 "Voucher Attachment Check"](../codeunit/5580.md) (4 calls: `CheckVoucherIsAttachedToDocument → CheckDigitalVoucherForDocument`, `GenerateDigitalVoucherForPostedDocument → GenerateDigitalVoucherForDocument`, `GenerateDigitalVoucherForPostedDocument → GetDigitalVoucherEntrySetup`, …)
- [Codeunit 5581 "Voucher Attach Or Note Check"](../codeunit/5581.md) (4 calls: `CheckVoucherIsAttachedToDocument → CheckDigitalVoucherForDocument`, `GenerateDigitalVoucherForPostedDocument → GenerateDigitalVoucherForDocument`, `GenerateDigitalVoucherForPostedDocument → GetDigitalVoucherEntrySetup`, …)
- [Codeunit 5588 "Voucher E-Document Check"](../codeunit/5588.md) (2 calls: `CheckVoucherIsAttachedToDocument → GetDigitalVoucherEntrySetup`, `GenerateDigitalVoucherForPostedDocument → GetDigitalVoucherEntrySetup`)
- [Codeunit 5584 "Dig. Voucher Manual Subscriber"](../codeunit/5584.md) (1 call: `AttachDigitalVoucherOnBeforeSaveDocumentAttachmentFromRecRe → AttachBlobToIncomingDocument`)

## Recent changes

- 2026-08-11 [#9208 [Enforced Digital Vouchers] - Attaching EDocuments when using Digital Vouchers](../../changes/bcapps/9208.md) (main, BC30, feature)

## 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: "Digital Voucher Impl.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
