> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.solutioo.de/entwicklerdokumentationen-business-central-dhl-connector/dhl-connector-entwicklerdokumentation/codeunit-referenz/72242986-soudhl-sales-shipment-mgt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
