Postman collection
Suppliers Write

pixiUpdateDelivery

Updates the header of a supplier delivery (note, external numbers, status, Picco/Mobix lock) by delivery ID or delivery number.

Updates one record in SDelHeader (supplier delivery header) and always returns exactly one row with the column ReturnMSG.

Identifying the delivery

  • SDelHkey and DeliveryNumber are treated as missing when they are 0. At least one of them is required.
  • If SDelHkey is given, it is used and DeliveryNumber is ignored.
  • Otherwise the delivery with SDelHNr = DeliveryNumber and the lowest key is used.

Validation

  • Status must be NEW, INV or CLS, or be left out (NULL), which keeps the current status. An empty string is rejected.
  • If ExternalReceiptNr is given, no other delivery of the same Lieferant may already carry this external receipt number.
  • Without PiccoUser: the delivery must exist and must not be locked by Picco (LockedByPicco is not Y).
  • With PiccoUser (Mobix/Picco client): the delivery must exist and either be assigned to this PiccoUser or not be locked by Picco.

Field handling

  • Note, extInvoiceNr and extOrderNr are trimmed. Empty or missing values keep the value already stored.
  • ExternalReceiptNr and Status: missing or empty values keep the stored value.
  • UserName defaults to API and is stored as the last updating user; the update date is set to the current time.
  • Picco information is always rewritten:
    • Without PiccoUser, the delivery's PiccoUser and LockedByPicco are cleared.
    • With PiccoUser, the user is stored and LockedByPicco is set to Y if LockDelivery = 1. If Status = CLS, both the Picco user and the lock are cleared.
  • SupplNr is obsolete. The supplier is never changed.

If the status actually changes, a delivery-status-changed event is published.

Notes

  • Note, extInvoiceNr, extOrderNr and ExternalReceiptNr cannot be cleared with this call. Empty values keep the existing content.
  • extOrderNr is declared as varchar(8000), but the internal update procedure accepts only varchar(1000). Longer values are truncated.
  • A call without PiccoUser removes an existing Picco user assignment from the delivery.
  • For a delivery locked by Picco, a call without PiccoUser fails with Delivery header does not exist, even though the delivery exists.
  • If DeliveryNumber matches no delivery, the same message is returned.
  • The procedure returns -1 as its return value on errors. Errors are reported only as a ReturnMSG row, not as SQL errors.
  • Existence checks read SDelHeader with NOLOCK. No explicit transaction is used.
  • On a status change, pixi_MQ_DeliveryStatusChanged_EventPublish is executed. Its definition is not attached, so the details of the published message are unknown.
  • The exact business meaning of the status INV is not visible in the code.

Tables used

SDelHeader · Write
SQL object:
dbo.pipiUpdateDelivery
Updated at 2026-10-30