> 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/72242986-soudhl-sales-shipment-mgt.md).

# 72242986 SOUDHL Sales Shipment Mgt

## Verantwortung

Verknüpft offene DHL-Verkaufsauftragspakete beim Buchen mit dem erzeugten Sales Shipment Header.

## Event Subscriber

Die Codeunit abonniert:

```al
Codeunit::"Sales-Post",
Event::OnAfterSalesShptHeaderInsert
```

Preview Mode wird ignoriert. Die Funktion läuft nur, wenn ein echter Sales Shipment Header angelegt wurde.

## Öffentliche Procedure

`AssignOpenOrderPackages(SalesHeader: Record "Sales Header"; SalesShipmentHeader: Record "Sales Shipment Header")`

### Guards

* Sales Header muss vom Typ Order sein.
* Dokumentnummern dürfen nicht leer sein.
* `SOUDHL Configuration` muss vorhanden sein.
* `Assign Packages on Sales Post` muss aktiviert sein.

### Wirkung

Filter auf:

* `Document Type = Sales Order`
* `Order No. = SalesHeader.No.`
* `Posted Sales Shipment No. = ''`

Danach wird `Posted Sales Shipment No.` per `ModifyAll(..., false)` gesetzt. Trigger werden bewusst nicht ausgeführt.

## Warum die Codeunit existiert

Pakete werden vor dem Buchen am Auftrag erzeugt. Nach dem Buchen benötigen Support, Lager und Nachdruck einen stabilen Link zur konkreten gebuchten Lieferung.

## Grenzen

* Warehouse-Shipment-Pakete werden nicht verändert.
* Bereits zugeordnete Pakete bleiben erhalten.
* Invoice-only-Prozesse ohne Shipment Header lösen den Subscriber nicht aus.

## Externe Verwendung

Normalerweise ist kein eigener Subscriber nötig. Tests oder Sonderbuchungen dürfen die öffentliche Procedure aufrufen, wenn dieselben Guards gewünscht sind.


---

# 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/72242986-soudhl-sales-shipment-mgt.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.
