---
id: object/codeunit/10758-es
type: object
title: Codeunit 10758 "SII Scheme Code Mgt." (ES)
summary: Codeunit 10758 "SII Scheme Code Mgt." (ES) in the ES country layer (Microsoft.EServices.EDocument). 15 public procedures, 1 events, 6 event subscribers. 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: 164c3d4e38df8685e4e477407f3434ffb6885536a339b05176d5d9cdac04d49b
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/ES/BaseApp/Local/SII/EServices/EDocument/SIISchemeCodeMgt.Codeunit.al
    title: src/Layers/ES/BaseApp/Local/SII/EServices/EDocument/SIISchemeCodeMgt.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/9643
object_type: codeunit
object_id: 10758
name: SII Scheme Code Mgt.
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: 27
  events: 1
  subscribers: 6
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
---

# Codeunit 10758 "SII Scheme Code Mgt." (ES)

> Codeunit 10758 "SII Scheme Code Mgt." (ES) in the ES country layer (Microsoft.EServices.EDocument). 15 public procedures, 1 events, 6 event subscribers. 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/SIISchemeCodeMgt.Codeunit.al) · facts from BC29

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

## Events published

- `OnGetSIISalesDocRecFromRec(var SIISalesDocumentSchemeCode: Record "SII Sales Document Scheme Code"; RecRef: RecordRef; var Result: Boolean)` (integration)

## Event subscriptions

- OnBeforePostSalesDoc subscribes to Codeunit "Sales-Post" OnBeforePostSalesDoc
- OnBeforePostPurchaseDoc subscribes to Codeunit "Purch.-Post" OnBeforePostPurchaseDoc
- OnAfterSalesInvHeaderInsert subscribes to Codeunit "Sales-Post" OnAfterSalesInvHeaderInsert
- OnAfterSalesCrMemoHeaderInsert subscribes to Codeunit "Sales-Post" OnAfterSalesCrMemoHeaderInsert
- OnAfterPurchInvHeaderInsert subscribes to Codeunit "Purch.-Post" OnAfterPurchInvHeaderInsert
- OnAfterPurchCrMemoHeaderInsert subscribes to Codeunit "Purch.-Post" OnAfterPurchCrMemoHeaderInsert

## Procedures

- `GetMaxNumberOfRegimeCodes(): Integer`
- `SalesDocHasRegimeCodes(RecVar: Variant): Boolean`
- `SalesDrillDownRegimeCodes(RecVar: Variant)`
- `MoveSalesRegimeCodesToPostedDoc(DocType: Option; DocNo: Code[20]; EntryType: Option; PostedDocType: Option; PostedDocNo: Code[20])` (internal)
- `PurchDocHasRegimeCodes(RecVar: Variant): Boolean`
- `PurchDrillDownRegimeCodes(RecVar: Variant)`
- `ValidateSalesSpecialRegimeCodeInSIIDocUploadState(xSIIDocUploadState: Record "SII Doc. Upload State"; SIIDocUploadState: Record "SII Doc. Upload State")`
- `ValidateServiceSpecialRegimeCodeInSIIDocUploadState(xSIIDocUploadState: Record "SII Doc. Upload State"; SIIDocUploadState: Record "SII Doc. Upload State")`
- `ValidatePurchSpecialRegimeCodeInSIIDocUploadState(xSIIDocUploadState: Record "SII Doc. Upload State"; SIIDocUploadState: Record "SII Doc. Upload State")`
- `UpdatePurchaseSpecialSchemeCodeInPurchaseHeader(PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header")`
- `UpdateSalesSpecialSchemeCodeInSalesHeader(SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")`
- `UpdateServiceSpecialSchemeCodeInSalesHeader(ServiceHeader: Record Microsoft.Service.Document."Service Header"; xServiceHeader: Record Microsoft.Service.Document."Service Header")` (obsolete 27.0: moved to codeunit Serv. SII Management)
- `UpdateSalesSpecialSchemeCodeInSalesLine(var SalesLine: Record "Sales Line")`
- `UpdatePurchSpecialSchemeCodeInPurchLine(var PurchaseLine: Record "Purchase Line")`
- `UpdatePurchSpecialSchemeCodeInServiceine(var ServiceLine: Record Microsoft.Service.Document."Service Line")` (obsolete 27.0: moved to codeunit Serv. SII Management)

Plus 5 local procedures.

## Triggers

OnRun

## Recent changes

- 2026-07-23 [#9643 Update SII subscribers SkipMissingPermissions](../../changes/bcapps/9643.md) (main, BC30, fix)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

## Deprecations

- procedure UpdatePurchSpecialSchemeCodeInServiceine: Pending 27.0 (#if not CLEAN27), "moved to codeunit Serv. SII Management"
- procedure UpdateServiceSpecialSchemeCodeInSalesHeader: Pending 27.0 (#if not CLEAN27), "moved to codeunit Serv. SII Management"

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 Scheme Code Mgt.")`, 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.
