---
id: object/codeunit/11042-de
type: object
title: Codeunit 11042 "ZUGFeRD Export Context" (DE)
summary: Codeunit 11042 "ZUGFeRD Export Context" (DE) in the DE country layer (Microsoft.eServices.EDocument.Formats). 5 public procedures, 3 events, 3 event subscribers. Introduced in BC30.
tier: official
language: en
tags:
  - codeunit
  - de layer
versions:
  introduced: "30"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-07T23:32:29.863Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 6a43d2e8f73b0b0a82b465dbe6e93ce23c11f76527bad60ecf810688cd2f6ebe
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/f18567dc08e2bd162bf192e1da4d714b57eb099f/src/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ZUGFeRDExportContext.Codeunit.al
    title: src/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ZUGFeRDExportContext.Codeunit.al (main)
    date: null
    commit: f18567dc08e2bd162bf192e1da4d714b57eb099f
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/de
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/9642
object_type: codeunit
object_id: 11042
name: ZUGFeRD Export Context
namespace: Microsoft.eServices.EDocument.Formats
app: EDocumentDE
extends: null
first_version: "30"
last_version: "30"
present_in:
  - "30"
changed_in: []
source_major: "30"
obsolete: null
countries: []
ms_search_form_ids: []
country: DE
counts:
  fields: 0
  procedures: 11
  events: 3
  subscribers: 3
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
---

# Codeunit 11042 "ZUGFeRD Export Context" (DE)

> Codeunit 11042 "ZUGFeRD Export Context" (DE) in the DE country layer (Microsoft.eServices.EDocument.Formats). 5 public procedures, 3 events, 3 event subscribers. Introduced in BC30.

DE country layer · Microsoft.eServices.EDocument.Formats · BC30 · [source at f18567dc](https://github.com/microsoft/BCApps/blob/f18567dc08e2bd162bf192e1da4d714b57eb099f/src/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ZUGFeRDExportContext.Codeunit.al) · facts from BC30

An object of the [DE localization](../../localizations/de.md), not part of W1.

## Properties

| Property | Value |
|---|---|
| Access | Public |

## Events published

- `OnSetEDocumentService(NewEDocumentService: Record "E-Document Service")` (internal)
- `OnHasContext(var Result: Boolean)` (internal)
- `OnGetEDocumentService(var EDocumentService: Record "E-Document Service")` (internal)

## Event subscriptions

- SubOnSetEDocumentService subscribes to Codeunit "ZUGFeRD Export Context" OnSetEDocumentService
- SubOnHasContext subscribes to Codeunit "ZUGFeRD Export Context" OnHasContext
- SubOnGetEDocumentService subscribes to Codeunit "ZUGFeRD Export Context" OnGetEDocumentService

## Procedures

- `Start()`: Binds this instance as the active ZUGFeRD export context for the current call stack and resets any captured service. Pair with .
- `Stop()`: Unbinds this instance from the current session's subscriber chain and clears the captured service so later operations in the same session do not see a stale value.
- `SetEDocumentService(NewEDocumentService: Record "E-Document Service")`: Publishes the triggering E-Document Service to the active bound context instance. Only meaningful between and ; when no instance is bound the publish has no observable effect.
- `HasContext(): Boolean`: Returns whether an instance is bound on the active session and call stack AND a non-blank E-Document Service was pushed into it. Report extensions gate their service read on this, so a plain print, a context that was started but never set, and a blank push all leave the legacy FindLast lookup in "Ex...
- `GetEDocumentService(var EDocumentService: Record "E-Document Service")`: Returns the E-Document Service pushed by the format via on the active bound instance, or a blank record when no context is bound.

## Recent changes

- 2026-09-29 [#9642 [Bug]: E-Documents for Germany - FindEDocumentService always selects last matching service, ignoring which service triggered the export](../../changes/bcapps/9642.md) (main, BC30, fix, added)

## Across versions

- Present in: BC30
- 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). 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: "ZUGFeRD Export Context")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.

A DE country object, not part of W1: the default corpus does not have it; `bcatlas_list_countries` shows which countries the atlas has.
