Postman collection
Orders Write

pixiSetOrderShippingLock

Sets or removes the shipping lock of an order by updating its delivery address and writing a shipping lock history entry.

Sets the shipping lock (ASlocked) on the delivery address of an order.

  1. Locked = NULL is treated as 1; an empty or NULL UserName becomes API.
  2. The delivery address reference (ShipAdrRef) is read from OrderHeader for OrderNr. If the order does not exist, or its ShipAdrRef is NULL, an ERROR row is returned.
  3. The referenced record in Addresses is selected only if it has AddrType = 'S' and its current ASlocked value differs from the target value (Y for lock, N for unlock). If no such address is found, an INFO row is returned and nothing is changed.
  4. If Reason is empty or NULL, it is replaced with Order was locked by {UserName} or Order was unlocked by {UserName}.
  5. A record is inserted into pixi.AddressesShippingLockHistory. It holds the user ID, the address key, the lock flag and the reason. The user ID is resolved from UserName via inf.UserGetByName, which falls back to the pixiAdministration user if the name is unknown.
  6. The address is updated:
    • ASlocked is set to Y/N.
    • UpdateDate is set to the current time.
    • UpdateEmp is set to the user name. The default API is written as API SetOrderShippingLock.
  7. An OK row is returned.

Notes

  • The lock is stored on the address record referenced by the order's ShipAdrRef, not on the order header itself.
  • The INFO row (already set to …) is also returned when the referenced address does not exist or does not have AddrType = 'S'. In that case the message can be misleading.
  • OrderHeader is read with NOLOCK; the address is selected with UPDLOCK.
  • No explicit transaction is used. The history insert and the address update are separate statements, so they are not rolled back together.
  • During the update, CONTEXT_INFO is temporarily set to 0x33999 and restored afterwards. This is presumably evaluated by triggers on Addresses, which are not attached.
  • Status rows always use the column name ErrorMessage, also for the OK case.

Tables used

OrderHeader · Read Addresses · Write AddressesShippingLockHistory · Write UCS_USERS · Read
SQL object:
dbo.pipiSetOrderShippingLock
Updated at 2026-10-30