---
id: object/codeunit/10750-es
type: object
title: Codeunit 10750 "SII XML Creator" (ES)
summary: Codeunit 10750 "SII XML Creator" (ES) in the ES country layer (Microsoft.EServices.EDocument). 7 public procedures, 47 events. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - es layer
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: 6d6de706ac529892bb119dd32d428e632151ca518fb35e1c8ac1f931dced9fa8
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/ES/BaseApp/Local/SII/EServices/EDocument/SIIXMLCreator.Codeunit.al
    title: src/Layers/ES/BaseApp/Local/SII/EServices/EDocument/SIIXMLCreator.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/es
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10631
    - change/bcapps/10230
object_type: codeunit
object_id: 10750
name: SII XML Creator
namespace: Microsoft.EServices.EDocument
app: Base Application
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
country: ES
counts:
  fields: 0
  procedures: 167
  events: 47
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
---

# Codeunit 10750 "SII XML Creator" (ES)

> Codeunit 10750 "SII XML Creator" (ES) in the ES country layer (Microsoft.EServices.EDocument). 7 public procedures, 47 events. Introduced in BC29, still in BC30.

ES country layer · Microsoft.EServices.EDocument · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/ES/BaseApp/Local/SII/EServices/EDocument/SIIXMLCreator.Codeunit.al) · facts from BC29

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

## Properties

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

## Events published

- `OnAfterBuildNonExemptTransactionType(VATEntry: Record "VAT Entry"; var TransactionType: Option S1,S2,S3,Initial)` (integration)
- `OnAfterCalculateCuotaDeducibleValue(var CuotaDeducibleValue: Decimal; var VATAmount: Decimal; var VATEntry: Record "VAT Entry")` (integration)
- `OnAfterCalculateNonExemptVATEntries(var TempVATEntryOut: Record "VAT Entry" temporary)` (integration)
- `OnAfterFillDetalleIVANode(var XmlNodeInnerXml: Text; TempVATEntry: Record "VAT Entry" temporary; UseSign: Boolean; Sign: Integer; FillEUServiceNodes: Boolean; NonExemptTransactionType: Option S1,S2,S3,Initial; RegimeCodes: array[3] of Code[2]; AmountNodeName: Text; var IsHandled: Boolean)` (integration)
- `OnAfterGetCustomerByGLSetup(var Customer: Record Customer; CustLedgerEntry: Record "Cust. Ledger Entry")` (integration)
- `OnAfterGetSalesExpeditionDate(CustLedgerEntry: Record "Cust. Ledger Entry"; var PostingDate: Date)` (integration)
- `OnAfterGenerateXmlDocument(LedgerEntry: Variant; var XMLDocOut: XmlDocument; UploadType: Option; IsCreditMemoRemoval: Boolean; var ResultValue: Boolean; RetryAccepted: Boolean; SIIVersion: Option; var isHandled: Boolean)` (integration)
- `OnAfterInitializePurchXmlBody(var XmlNodeInnerXml: Text; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration)
- `OnBeforeAddLineAmountElement(var TempVATEntry: Record "VAT Entry" temporary; AmountNodeName: Text; var Amount: Decimal)` (integration)
- `OnBeforeAddVATAmountPurchDiffElement(var TempVATEntry: Record "VAT Entry" temporary; var VATAmountDiff: Decimal)` (integration)
- `OnBeforeContraparteNode(var XMLNode: DotNet XmlNode; CustLedgerEntry: Record "Cust. Ledger Entry")` (integration)
- `OnBeforeGenerateXmlDocument(LedgerEntry: Variant; var XMLDocOut: XmlDocument; UploadType: Option; IsCreditMemoRemoval: Boolean; var ResultValue: Boolean; var IsHandled: Boolean; RetryAccepted: Boolean; SIIVersion: Option)` (integration)
- `OnBeforeGetClaveRegimenNodePurchases(SIIDocUploadState: Record "SII Doc. Upload State"; VendLedgerEntry: Record "Vendor Ledger Entry"; Vendor: Record Vendor; var RegimeCode: Code[2]; var IsHandled: Boolean)` (integration)
- `OnBeforeGetClaveRegimenNodeSales(SIIDocUploadState: Record "SII Doc. Upload State"; CustLedgerEntry: Record "Cust. Ledger Entry"; Customer: Record Customer; var RegimeCode: Code[2]; var IsHandled: Boolean)` (integration)
- `OnCalculateNonExemptVATEntriesOnAfterTempVATEntryOutSetFilters(var TempVATEntryOut: Record "VAT Entry" temporary; TempVATEntry: Record "VAT Entry" temporary; SplitByEUService: Boolean; VATAmount: Decimal)` (integration)
- `OnCalculateTotalVatAndBaseAmountsOnBeforeAssignTotalBaseAmount(LedgerEntryRecRef: RecordRef; var VATEntry: Record "VAT Entry")` (integration)
- `OnFillFechaOperacionOnBeforeAddElementWithPrefix(var LastShptRcptDate: Date; PostingDate: Date)` (integration)
- `OnFillDetalleIVANodeOnAfterTempVATEntryClearFilters(var TempVATEntry: Record "VAT Entry" temporary)` (integration)
- `OnFillDetalleIVANodeOnAfterTempVATEntrySetFilters(var TempVATEntry: Record "VAT Entry" temporary)` (integration)
- `OnFillDetalleIVANodeOnBeforeExportTipoImpositivo(var XMLNode: DotNet XmlNode; var TempVATEntry: Record "VAT Entry" temporary)` (integration)
- `OnGenerateNodeForFechaOperacionSalesOnBeforeFillFechaOperacion(var LastShipDate: Date; SalesInvoiceHeader: Record "Sales Invoice Header")` (integration)
- `OnHandleReplacementPurchCorrectiveInvoiceOnBeforeAddElementDetalleIVA(var XMLNode: DotNet XmlNode; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration)
- `OnHandleReplacementPurchCorrectiveInvoiceOnBeforeAddCuotaDeducibleElement(VendorLedgerEntry: Record "Vendor Ledger Entry"; var CuotaDeducibleDecValue: Decimal; var BaseAmountDiff: Decimal)` (integration)
- `OnPopulateXMLWithSalesInvoiceOnAfterContraparteNode(var TipoDesgloseXMLNode: DotNet XmlNode; var DesgloseFacturaXMLNode: DotNet XmlNode; var DomesticXMLNode: DotNet XmlNode; var DesgloseTipoOperacionXMLNode: DotNet XmlNode; IsService: Boolean; DomesticCustomer: Boolean; CustLedgerEntry: Record "Cust. Ledger Entry"; SiiTxt: Text; var IsHandled: Boolean)` (integration)
- `OnPopulateXMLWithPurchInvoiceOnBeforeDesgloseFacturaNode(var XMLNode: DotNet XmlNode; var TempVATEntryCalculated: Record "VAT Entry" temporary; XMLNodeName: Text; RegimeCodes: array[3] of Code[2]; VendorLedgerEntry: Record "Vendor Ledger Entry"; SiiTxt: Text; var IsHandled: Boolean; TempVATEntryNormalCalculated: Record "VAT Entry" temporary; TempVATEntryReverseChargeCalculated: Record "VAT Entry" temporary)` (integration)
- `OnGenerateNodeForFechaOperacionSalesCrMemoHeaderOnBeforeFillFechaOperacion(var LastShipDate: Date; SalesCrMemoHeader: Record "Sales Cr.Memo Header")` (integration)
- `CorrectiveInvoiceSalesDifferenceOnBeforeContraparteNode(var XMLNode: DotNet XmlNode; var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration)
- `HandleReplacementSalesCorrectiveInvoiceOnBeforeContraparteNode(var XMLNode: DotNet XmlNode; var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration)
- `OnAfterAddPurchTail(var XMLNode: DotNet XmlNode; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration)
- `OnInitializePurchXmlBodyOnBeforeAssignExerciseAndPeriod(var XMLNode: DotNet XmlNode; VendorLedgerEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean)` (integration)
- `OnFillThirdPartyIdOnBeforeCheckCountryAndVATRegNo(var CountryCode: Code[20])` (integration)
- `OnHandleReplacementPurchCorrectiveInvoiceOnAfterGenerateRecargoEquivalenciaNodes(var XMLNode: DotNet XmlNode; TempVATEntry: Record "VAT Entry")` (integration)
- `OnFillDetalleIVANodeOnAfterGenerateRecargoEquivalenciaNodes(var XMLNode: DotNet XmlNode; TempVATEntry: Record "VAT Entry")` (integration)
- `OnHandleReplacementPurchCorrectiveInvoiceOnAfterCuotaDeducible(var XMLNode: DotNet XmlNode; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration)
- `OnFillThirdPartyIdOnBeforeAssignValues(SIIDocUploadState: Record "SII Doc. Upload State"; var CountryCode: Code[20]; var Name: Text; var VatNo: Code[20]; IsIntraCommunity: Boolean)` (integration)
- `OnBeforeCalculateTotalVatAndBaseAmounts(LedgerEntryRecRef: RecordRef; var TotalBaseAmount: Decimal; var TotalNonExemptVATBaseAmount: Decimal; var TotalVATAmount: Decimal; var IsHandled: Boolean)` (integration)
- `OnPopulateXMLWithPurchInvoiceOnBeforeAddNodeForTotals(var AddNodeForTotals: Boolean; var VendorLedgerEntry: Record "Vendor Ledger Entry"; var TotalBase: Decimal; var TotalNonExemptBase: Decimal; var TotalVATAmount: Decimal)` (integration)
- `OnPopulateXMLWithSalesInvoiceOnBeforeAddNodeForTotals(var AddNodeForTotals: Boolean; var CustLedgerEntry: Record "Cust. Ledger Entry"; var TotalBase: Decimal; var TotalNonExemptBase: Decimal; var TotalVATAmount: Decimal)` (integration)
- `OnPopulateXMLWithSalesInvoiceOnBeforeFillRefExternaNode(var SIIDocUploadState: Record "SII Doc. Upload State"; var ValueRefExternal: Text)` (integration)
- `OnPopulateXMLWithSalesInvoiceOnBeforeInitializeSalesXmlBody(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration)
- `OnGetCorrectionInfoFromDocument(DocumentNo: Code[20]; var CorrectedInvoiceNo: Code[20]; var CorrectionType: Option; var IsHandled: Boolean)` (integration)
- `OnGetOperationDescriptionFromDocument(DocumentNo: Code[35]; var OperationDescription: Text; var ShouldExit: Boolean)` (integration)
- `OnPopulateXMLWithPurchInvoiceOnBeforeFillRefExternaNode(var SIIDocUploadState: Record "SII Doc. Upload State"; var ValueRefExternal: Text)` (integration)
- `OnCorrectiveInvoiceSalesDifferenceOnBeforeFillRefExternaNode(var SIIDocUploadState: Record "SII Doc. Upload State"; var ValueRefExternal: Text)` (integration)
- `OnHandleReplacementSalesCorrectiveInvoiceOnBeforeFillRefExternaNode(var SIIDocUploadState: Record "SII Doc. Upload State"; var ValueRefExternal: Text)` (integration)
- `OnHandleNormalPurchCorrectiveInvoiceOnBeforeFillRefExternaNode(var SIIDocUploadState: Record "SII Doc. Upload State"; var ValueRefExternal: Text)` (integration)
- `OnHandleReplacementPurchCorrectiveInvoiceOnBeforeFillRefExternaNode(var SIIDocUploadState: Record "SII Doc. Upload State"; var ValueRefExternal: Text)` (integration)

## Procedures

- `GenerateXml(LedgerEntry: Variant; var XMLDocOut: DotNet XmlDocument; UploadType: Option; IsCreditMemoRemoval: Boolean): Boolean`
- `FormatDate(Value: Date): Text`
- `FormatNumber(Number: Decimal): Text`
- `GetLastErrorMsg(): Text`
- `SetIsRetryAccepted(NewRetryAccepted: Boolean)`
- `SetSIIVersionNo(NewSIIVersion: Option)`
- `Reset()`

Plus 113 local procedures.

## Triggers

OnRun

## Recent changes

- 2026-08-26 [#10631 Integration/main to releases 29.x 31a860b5](../../changes/bcapps/10631.md) (releases/29.x, BC29, feature)
- 2026-08-24 [#10230 [Main]<ImporteTAIReglasLocalizacion> node should have negative sign in the SII XML for Sales Credit Memos under One-Stop-Shop regime in the Spanish version](../../changes/bcapps/10230.md) (main, BC30, fix)

## 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). 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: "SII XML Creator")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.

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