---
id: object/codeunit/5280
type: object
title: Codeunit 5280 "SAF-T Data Mgt."
summary: Codeunit 5280 "SAF-T Data Mgt." in SAF-T (Microsoft.Finance.AuditFileExport). 35 public procedures. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - saf-t
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: f63f5d711a7fb70c125c7ade7ff013706e5d68550187d66bdcfa850d5cc0f251
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/SAF-T/app/src/SAFTDataMgt.Codeunit.al
    title: src/Apps/W1/SAF-T/app/src/SAFTDataMgt.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 5280
name: SAF-T Data Mgt.
namespace: Microsoft.Finance.AuditFileExport
app: SAF-T
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: 37
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 3
  called_by: 5
  implements: 0
---

# Codeunit 5280 "SAF-T Data Mgt."

> Codeunit 5280 "SAF-T Data Mgt." in SAF-T (Microsoft.Finance.AuditFileExport). 35 public procedures. Introduced in BC29, still in BC30.

SAF-T · Microsoft.Finance.AuditFileExport · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/SAF-T/app/src/SAFTDataMgt.Codeunit.al) · facts from BC29

## Properties

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

## Procedures

- `GetNotApplicableVATCode(): Code[9]`: Returns the VAT Reporting Code that is used in cases when the VAT Reporting Code is not set in VAT Posting Setup.
- `GetISOCurrencyCode(CurrencyCode: Code[10]): Code[10]`: Returns the ISO 4217 currency code for the specified currency.
- `GetISOCountryCode(CountryRegionCode: Text): Code[2]`: Returns the country code in ISO 3166-1 alpha-2 format.
- `GetSAFTMonetaryDecimal(InputDecimal: Decimal): Text`: Rounds the decimal to 2 decimal places and converts it to the XML format.
- `GetSAFTExchangeRateDecimal(InputDecimal: Decimal): Text`: Rounds the decimal to 8 decimal places and converts it to the XML format.
- `GetSAFTCodeText(InputText: Text): Text`: Returns the text of length 9.
- `GetSAFTShortText(InputText: Text): Text`: Returns the text of length 18.
- `GetSAFTMiddle1Text(InputText: Text): Text`: Returns the text of length 35.
- `GetSAFTMiddle2Text(InputText: Text): Text`: Returns the text of length 70.
- `FormatAmount(AmountToFormat: Decimal): Text`: Converts the decimal to its text representation allowed in the XML.
- `CombineWithSpace(FirstString: Text; SecondString: Text): Text`: Combines two strings with a space between them.
- `GetZipFileName(): Text[1024]`: Returns the name of the zip archive to which the SAF-T files are added.
- `GetXmlFileName(CreatedDateTime: DateTime; NumberOfFile: Integer; TotalNumberOfFiles: Integer): Text[1024]` (internal)
- `GetEnvironmentCountryCode(): Text` (internal)
- `GetDateTimeForFileName(CreatedDateTime: DateTime): Text` (internal)
- `GetFirstAndLastNameFromContactName(var FirstName: Text; var LastName: Text; ContactName: Text)` (internal)
- `GetAppliedSalesDocuments(CustLedgerEntryNo: Integer; AppliedDocumentType: Enum "Gen. Journal Document Type"): List of [Code[20]]` (internal)
- `GetAppliedPurchaseCreditMemos(VendorLedgerEntryNo: Integer; AppliedDocumentType: Enum "Gen. Journal Document Type"): List of [Code[20]]` (internal)
- `GetTotalAmountCustomerDocuments(StartingDate: Date; EndingDate: Date; DocumentType: Enum "Gen. Journal Document Type"): Decimal` (internal)
- `GetTotalAmountVendorDocuments(StartingDate: Date; EndingDate: Date; DocumentType: Enum "Gen. Journal Document Type"): Decimal` (internal)
- `GetFCYData(var CurrencyCode: Code[10]; var ExchangeRate: Decimal; var GLEntry: Record "G/L Entry"; ExportCurrencyInfo: Boolean)` (internal)
- `GetShipToAddressFromItemLedgerEntry(var ItemLedgerEntry: Record "Item Ledger Entry"; var ShipToAddress: Record "Ship-to Address")` (internal)
- `GetShipFromAddressFromItemLedgerEntry(var ItemLedgerEntry: Record "Item Ledger Entry"; var ShipFromAddress: Record "Ship-to Address"; var PackageTrackingNo: Text)` (internal)
- `GetFixedAssetAcquisitionLedgerEntry(var AcquisitionFALedgerEntry: Record "FA Ledger Entry"; FixedAssetNo: Code[20])` (internal)
- `GetFixedAssetAcquisitionVendorNo(var AcquisitionFALedgerEntry: Record "FA Ledger Entry"): Code[20]` (internal)
- `GetFixedAssetBookValueOnTransactionDate(var TransactionFALedgerEntry: Record "FA Ledger Entry"): Decimal` (internal)
- `GetGoodsServicesID(IsService: Boolean): Text` (internal)
- `GetDebitCreditIndicator(Amount: Decimal): Text` (internal)
- `GetMovementEntryType(EntryType: Enum "Item Ledger Entry Type"): Text` (internal)
- `GetMovementDocType(DocumentType: Enum "Item Ledger Document Type"): Text` (internal)
- `GetAssetTransactionType(FAPostingType: Enum "FA Ledger Entry FA Posting Type"): Text` (internal)
- `GetAmountInfoFromGLEntry(var AmountXMLNode: Text; var Amount: Decimal; GLEntry: Record "G/L Entry")` (internal)
- `IsSalesLineService(SourceType: Enum "Sales Line Type"; SourceNo: Code[20]): Boolean` (internal)
- `IsPurchaseLineService(SourceType: Enum "Purchase Line Type"; SourceNo: Code[20]): Boolean` (internal)
- `IsGLAccInCurrencyGainLossAcc(GLAccNo: Code[20]; CurrencyCode: Code[10]): Boolean` (internal)

Plus 2 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 226 "CustEntry-Apply Posted Entries"](../codeunit/226.md) (1 call: `GetAppliedSalesDocuments → GetAppliedCustLedgerEntries`)
- [Codeunit 227 "VendEntry-Apply Posted Entries"](../codeunit/227.md) (1 call: `GetAppliedPurchaseCreditMemos → GetAppliedVendLedgerEntries`)
- [Codeunit 457 "Environment Information"](../codeunit/457.md) (1 call: `GetEnvironmentCountryCode → GetApplicationFamily`)

## Called by

- [Codeunit 5289 "Generate File SAF-T"](../codeunit/5289.md) (117 calls: `ExportAddress → GetISOCountryCode`, `ExportAddress → GetSAFTMiddle1Text`, `ExportAddress → GetSAFTMiddle2Text`, …)
- [Page 5280 "SAF-T Wizard"](../page/5280.md) (2 calls: `OnOpenPage → GetZipFileName`, `ShowVATSettings → GetEnvironmentCountryCode`)
- [Codeunit 5281 "Audit Data Handling SAF-T"](../codeunit/5281.md) (1 call: `GetFileNameForAuditFileExportLine → GetXmlFileName`)
- [Codeunit 5286 "Data Check Mgt. SAF-T"](../codeunit/5286.md) (1 call: `CheckVATPostingSetup → GetEnvironmentCountryCode`)
- [Page 5283 "VAT Posting Setup SAF-T"](../page/5283.md) (1 call: `SetFieldsMandatory → GetEnvironmentCountryCode`)

## 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: "SAF-T Data Mgt.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
