Postman collection
Stock Write

pixiBinUpdate

Updates one or more existing bins (Lagerplatz) from an XML list and returns a status row for each bin.

Updates existing bins in InvBin. Bins are identified by BinKey; new bins are not created.

  1. If BinsXML is empty or cannot be parsed as XML, a single ERROR row is returned and nothing is changed.
  2. Every /Bins/Bin element is read: BinKey, Name, LocId, Group, SortNr, MaxItems, TransportBin.
  3. Each bin is validated. A bin that fails a check gets Status = ERROR and a message, and is skipped. The first failing check wins. The checks are:
    • BinKey is missing or 0.
    • SortNr or MaxItems is not an integer, or is negative.
    • LocId differs from the current location and the bin still has stock (InvBinItem).
    • The resulting name already exists on another bin:
      • on the same location, always checked;
      • on another location, only checked if the setting FilterStockOperationsWithLocation is 0;
      • if TransportBin = 1 is sent, among all transport bins.
    • The given LocId does not exist in Location.
    • No bin with that BinKey exists.
  4. All valid bins are updated in one transaction. Elements that are left out keep their current value. The update sets BinName, BinLocID, BinGroup, BinSortNum, BinMaxItems and TransportBin, plus UpdateEmp and UpdateDate.
  5. One row per Bin element is returned, ordered by its position in the XML (Row). Each row has Status = UPDATED or ERROR.

Notes

  • Retaining values: most elements are read via text(), so an empty element (e.g. <SortNr/>) counts as omitted and the current value is kept. Group is read without text(): an empty <Group/> sets the group to an empty string.
  • Returned values: the result rows contain the values as sent in the XML, not the merged values stored in InvBin. Omitted fields are returned as NULL.
  • Transport bins: the transport-bin duplicate check does not exclude the bin itself. Sending TransportBin = 1 for a bin that already is a transport bin therefore reports Bin Name not updated (Duplicated)..
  • Duplicates within one request: names are only checked against existing rows in InvBin, not against other Bin elements of the same request.
  • Unchecked check: the check Bin not updated. Name is empty. only applies to rows without BinKey. Such rows already fail the BinKey check, so this message does not occur in practice.
  • Conversion errors: a non-integer BinKey or an invalid TransportBin value (anything other than 0, 1, true, false) fails during XML reading. This happens before the TRY block and comes back as SqlMessage. SortNr and MaxItems are parsed with TRY_PARSE and produce status rows instead.
  • Validation hints: validation reads InvBin, InvBinItem and Location with NOLOCK.
  • Transaction: the update uses ROWLOCK inside its own transaction, or a savepoint if a transaction is already open.
  • Unexpected errors: the error is logged via log.InsertError (not attached), the transaction is rolled back and a row Status = ERROR is returned. Its Message contains @@ERROR after the logging call, so it is a number (typically 0), not the error text.
  • UpdateEmp: an empty UpdateEmp is replaced by API.

Tables used

InvBin · Write InvBinItem · Read Location · Read Settings · Read
SQL object:
dbo.pipiBinUpdate
Updated at 2026-10-30