> For the complete documentation index, see [llms.txt](https://docs.solutioo.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.solutioo.de/entwicklerdokumentationen-business-central-dhl-connector/dhl-connector-entwicklerdokumentation/codeunit-referenz/72242953-soudhl-config-upgrade.md).

# 72242953 SOUDHL Config Upgrade

## Verantwortung

Upgrade-Codeunit für idempotente Datenmigrationen zwischen DHL-Connector-Versionen. `Subtype = Upgrade`.

## `OnUpgradePerCompany()`

Die Reihenfolge schützt vorhandene Daten:

1. Alpha-3-Ländercodes nachpflegen.
2. `Billing Number Short` aus dem Legacy-Feld übernehmen.
3. Warehouse-Source-Referenzen in alten Package Lines ergänzen.
4. Billing-Number-Tabelle seeden.
5. EKPs auf zehn Zeichen normalisieren.
6. Packing-Einheiten aus historischen UoM-Feldern in die Konfiguration migrieren.
7. für jeden Schritt einen Upgrade Tag setzen.

## Öffentliche Migrations-API

### `SeedBillingNumbersFromConfigAndMap()`

Legt nur dann einen `DEFAULT`-Datensatz an, wenn die Billing-Number-Tabelle leer ist und eine exakt zehnstellige EKP aus der aktuellen oder Legacy-Konfiguration gewonnen werden kann.

## Öffentliche Tag-Procedures

* `WhseShptPackageLinkUpgradeTag(): Code[250]`
* `BillingNumbersUpgradeTag(): Code[250]`
* `BillingNumbersEKPUpgradeTag(): Code[250]`
* `PackingUnitsFromUomUpgradeTag(): Code[250]`

Sie liefern die stabilen IDs der jeweiligen Migration und ermöglichen Tests oder Folgemigrationen, ohne Stringduplikate.

## Lokale Migrationen

* `UpgradeExistingPackagesToSalesOrderType`: füllt Source Order/Line in alten Package Lines.
* `NormalizeBillingNumbersToEKP`: kürzt auf zehn Zeichen und stellt einen Default sicher.
* `UpgradePackingUnitsFromUom`: ermittelt den Mehrheitswert der historischen UoM-Einheiten und schreibt Dimension/Weight Unit in Configuration.

## Invarianten

Jede Migration prüft `HasUpgradeTag`, arbeitet idempotent und setzt erst danach `SetUpgradeTag`.

## Externe Verwendung

Consumer-Apps sollen diese Codeunit nicht regulär aufrufen. Öffentliche Seed-/Tag-Methoden dienen Installation, Upgrade und Tests. Eigene Migrationen dürfen die Tags lesen, aber nicht vorzeitig setzen.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.solutioo.de/entwicklerdokumentationen-business-central-dhl-connector/dhl-connector-entwicklerdokumentation/codeunit-referenz/72242953-soudhl-config-upgrade.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
