Postman collection
Suppliers Write

pixiDeleteDeliveryItem

Deletes one or more item lines from a supplier delivery, identified by delivery line key, internal item number or EAN.

Removes item lines (SDelDetail) from a supplier delivery (SDelHeader).

Identifying the delivery. Pass either SDelHKey or DeliveryNumber, which is matched against SDelHNr. If only DeliveryNumber is given, the first matching SDelHKey is used.

Identifying the lines. Pass at least one of SDelDKey, ItemNrInternal or EANUPC.

Validation, in this order:

  1. A delivery reference or number is present.
  2. An item identifier is present.
  3. The delivery is not locked by Picco (LockedByPicco is NULL).
  4. The SDelDKey exists in SDelDetail, if given.
  5. The EANUPC exists in Items, if given.
  6. The ItemNrInternal exists in Items (ItemNrInt), if given.
  7. The delivery exists and its status is not CLS (closed) or INV (invoiced).

If a check fails, the call raises an error and nothing is deleted.

Deletion.

  • If SDelDKey is given, exactly that delivery line is deleted. ItemNrInternal and EANUPC are then ignored for the deletion.
  • Otherwise the call deletes all lines of the delivery whose item matches ItemNrInternal or EANUPC. This can remove several lines.

The call returns no result set.

Notes

  • Line key not checked against the delivery. When deleting by SDelDKey, the code does not check that the line belongs to the given delivery. The status and lock checks apply to the delivery passed in, but the line with that key is deleted even if it belongs to another delivery.
  • Unknown delivery number gives a misleading error. If DeliveryNumber does not match any delivery, the key stays NULL. The call then fails with You cant delete items from closed or invoiced deliveries.
  • Item checks are global. The EANUPC and ItemNrInternal checks only test that the item exists in Items. If the item exists but is not on the delivery, nothing is deleted and no error is raised.
  • Both identifiers match with OR. If both ItemNrInternal and EANUPC are given without SDelDKey, lines matching either value are deleted.
  • Zero counts as empty. Empty values are converted to NULL. Because the integer parameters are compared with '', the value 0 for SDelHKey, DeliveryNumber or SDelDKey is also treated as not provided.
  • No transaction and loose lock read. The procedure does not use an explicit transaction. The lock flag LockedByPicco is read WITH (NOLOCK).
  • Return code. On errors the procedure returns -1 after RAISERROR with severity 16.

Tables used

SDelHeader · Read SDelDetail · Write Items · Read
SQL object:
dbo.pipiDeleteDeliveryItem
Updated at 2026-10-30