Postman collection
Suppliers Write

pixiUpdateSupplier

Updates the master data, main contact, lock and disabled flags of an existing supplier identified by its supplier number.

Performs a partial update of one supplier in Suppliers, identified by SupplNr.

  1. Empty strings in most parameters are converted to NULL. SupplCtry is trimmed first. A parameter that is NULL or empty leaves the stored value unchanged (ISNULL(new, old)).
  2. The supplier is looked up by SupplNr. If it does not exist, an error row is returned.
  3. If IsLocked = 1 or IsDisabled = 1, SupplierNote is mandatory. If it is given, a note with the title Supplier Locked by UserId: {id} or Supplier Disabled by UserId: {id} is inserted into SupplierNote. The user is the Pixi user api, or pixiAdministration if api does not exist. If both flags are 1, two notes are created.
  4. Within a transaction (or a savepoint if the caller already has an open transaction):
    • If the supplier has no ContactId yet, an empty Contact record is created and linked.
    • The supplier fields are updated. UpdateDate is set to the current time and UpdateEmp to API.
    • The linked contact is updated with the MainContact_* values.
  5. One status row is returned with RowsAffected, ReturnCode, Message and ErrorMessage.

CanDoDirectFulfillment accepts Y/N. Other values leave the flag unchanged. IsLocked = 0 and IsDisabled = 0 unlock or enable the supplier without requiring a note.

Notes

  • Notes outside the transaction: the SupplierNote insert for locking or disabling runs before the transaction starts. It is not rolled back if the later update fails. It is also attempted when the supplier does not exist; in that case SupplierId is NULL. Database errors from this insert are not caught and come back as SqlMessage.
  • Missing SupplNr: the message for an empty SupplNr is overwritten by the "does not exist" message. That message is built by concatenating NULL, so the result is NULL. The caller receives ReturnCode = Error with an empty or NULL ErrorMessage.
  • Error precedence: a missing-note error for lock/disable overrides the "does not exist" message in ErrorMessage.
  • Zero values: DefaultDeliveryDays and CurrencyId are compared with '', which converts to 0. The value 0 is therefore treated as "not provided" and cannot be set.
  • Fields that cannot be cleared: an empty string never clears a field, because it is treated as "no change".
  • Unused parameter: SupplGroup is declared but not used.
  • Message text: the generic message contains the typo conntact.
  • Locking: reads use NOLOCK, updates use ROWLOCK. XACT_ABORT is on. On a caught error, the transaction or savepoint is rolled back and an error row is returned.
  • Contact update: the contact's RowVersion is always set to 1.

Tables used

Suppliers · Write SupplierNote · Write Contact · Write UCS_USERS · Read
SQL object:
dbo.pipiUpdateSupplier
Updated at 2026-10-30