---
id: object/codeunit/11503-ch
type: object
title: Codeunit 11503 "CHMgt" (CH)
summary: Codeunit 11503 "CHMgt" (CH) in the CH country layer (Microsoft.Bank.Payment). 12 public procedures, 2 events, 7 event subscribers. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - ch 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: 9fb231a2d379a4869b837e33905c9e62e37fb4c65d997379cc0df23b592a999e
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/CH/BaseApp/Local/Bank/Payment/CHMgt.Codeunit.al
    title: src/Layers/CH/BaseApp/Local/Bank/Payment/CHMgt.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/ch
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10136
object_type: codeunit
object_id: 11503
name: CHMgt
namespace: Microsoft.Bank.Payment
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: CH
counts:
  fields: 0
  procedures: 26
  events: 2
  subscribers: 7
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
---

# Codeunit 11503 "CHMgt" (CH)

> Codeunit 11503 "CHMgt" (CH) in the CH country layer (Microsoft.Bank.Payment). 12 public procedures, 2 events, 7 event subscribers. Introduced in BC29, still in BC30.

CH country layer · Microsoft.Bank.Payment · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/CH/BaseApp/Local/Bank/Payment/CHMgt.Codeunit.al) · facts from BC29

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

## Events published

- `OnPrepareEsrOnAfterCalcAmt(var SalesInvoiceHeader: Record "Sales Invoice Header"; var Amt: Decimal)` (integration)
- `OnPrepareEsrOnBeforeCompressArray(var SalesInvoiceHeader: Record "Sales Invoice Header"; var Adr: array[8] of Text[100])` (integration)

## Event subscriptions

- SuggestVendorPaymentFromBufferUpdatePaymentLine subscribes to Report "Suggest Vendor Payments" OnBeforeUpdateGnlJnlLineDimensionsFromVendorPaymentBuffer
- HandleOnAfterCopyFieldsFromVendorLedgerEntryFromBuffer subscribes to Table "Vendor Payment Buffer" OnAfterCopyFieldsFromVendorLedgerEntry
- HandleOnAfterCopyFieldsToGenJournalLineFromBuffer subscribes to Table "Vendor Payment Buffer" OnAfterCopyFieldsToGenJournalLine
- HandleOnAfterSetJournalLineFieldsFromApplication subscribes to Table "Gen. Journal Line" OnAfterSetJournalLineFieldsFromApplication
- HandleOnAfterSalesLineSetFilters subscribes to Codeunit "Document Totals" OnAfterSalesLineSetFilters
- HandleOnAfterSalesCheckIfDocumentChanged subscribes to Codeunit "Document Totals" OnAfterSalesCheckIfDocumentChanged
- HandleOnCalculateSalesSubPageTotalsOnAfterSetFilters subscribes to Codeunit "Document Totals" OnCalculateSalesSubPageTotalsOnAfterSetFilters

## Procedures

- `PrepareEsr(SalesInvHeader: Record "Sales Invoice Header"; var ESRSetup: Record "ESR Setup"; var EsrType: Option Default,ESR,"ESR+"; var Adr: array[8] of Text[100]; var AmtTxt: Text[30]; var CurrencyCode: Code[10]; var DocType: Text[10]; var RefNo: Text[35]; var CodingLine: Text[100])`
- `PrepareEsrConsolidate(var ESRSetup: Record "ESR Setup"; var EsrType: Option Default,ESR,"ESR+"; var AmtTxt: Text[30]; var CurrencyCode: Code[10]; var DocType: Text[10]; var RefNo: Text[35]; var CodingLine: Text[100]; CurrencyCode2: Code[10]; PaymentMethodCode: Code[10]; _No: Code[20]; Amt: Decimal)`
- `ReplaceXMLNamespaceCaption(var TempBlob: Codeunit "Temp Blob"; OldCaption: Text; NewCaption: Text)`
- `IsSwissSEPACTExport(GenJournalLine: Record "Gen. Journal Line"): Boolean`
- `IsSwissSEPADDExport(DirectDebitCollectionNo: Integer): Boolean`
- `IsSwissSEPACTImport(BankAccountNo: Code[20]): Boolean`
- `IsDomesticIBAN(IBAN: Code[50]): Boolean`
- `GetClearingNoFromIBAN(IBAN: Code[50]): Code[5]` (internal): Extracts the Swiss bank clearing number (IID) from a domestic (CH/LI) IBAN.
- `IsDomesticCurrency(CurrencyCode: Code[10]): Boolean`
- `IsSEPACountry(CountryCode: Code[10]): Boolean`
- `IsESRFormat(RefNo: Text): Boolean`
- `NoOfPaymentsForBatchBooking(): Integer` (obsolete 29.0: The batch booking behavior is now configurable per bank account via the SEPA CT Batch Booking field.)

Plus 5 local procedures.

## Triggers

OnRun

## Recent changes

- 2026-08-17 [#10136 [CH][SEPA CT] Export requires both IBAN and Clearing No. for domestic payments and refunds](../../changes/bcapps/10136.md) (main, BC30, fix)

## Across versions

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

## Deprecations

- procedure NoOfPaymentsForBatchBooking: Pending 29.0 (#if not CLEAN29), "The batch booking behavior is now configurable per bank account via the SEPA CT Batch Booking field."

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

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