Postman collection
Customers Write

pixiSetShippingLock

Sets or removes the shipping lock (`SLocked`) of a customer, identified by `CustKey` or by external customer number and shop.

Sets the shipping lock flag of one customer record in Customers.

  1. UserName is trimmed. If it is empty or missing, API is used. The value is written to Customers.UpdateEmp.
  2. Locked is converted to the stored value: 1 becomes Y. Any other value, including 0 and NULL, becomes N.
  3. If CustomerNrExternal is not empty, the procedure looks up the CustKey of the customer whose CustomerNrExternal matches and whose CustomerOf equals ShopID. If several customers match, only one of them (TOP 1, no defined order) is used.
  4. The customer with the resulting CustKey gets SLocked and UpdateEmp updated.
  5. A single row with the column Result is returned: 0 if exactly one customer was updated, 1 otherwise.

Notes

  • If CustomerNrExternal is given but no customer matches, the variable keeps the passed CustKey. In that case the customer with that CustKey is updated, or nothing is updated if CustKey is NULL.
  • ShopID is compared with =. If ShopID is NULL while CustomerNrExternal is set, the lookup never finds a match.
  • If neither CustKey nor a matching external number is given, no row is updated and Result = 1 is returned.
  • The lookup uses UPDLOCK. There is no explicit transaction, so the lock is held only for the duration of that statement.
  • No error messages are produced. Only the Result value indicates success or failure.

Tables used

Customers · Write
SQL object:
dbo.pipiSetShippingLock
Updated at 2026-10-30