Postman collection
Customers Read

pixiGetComments

Returns the comments of a customer (from the customer history) and/or of an order, newest first, with offset-based paging.

Collects comments for a customer, an order or both and returns them in one list.

  1. If both CustomerNrExternal and OrderNr are NULL or empty, a single error row (ReturnCode = ERROR) is returned and nothing else happens.
  2. If CustomerNrExternal is not NULL, all entries of the customer history whose note text is not NULL are collected for the customer with this external customer number, as type CustomerComment. They are numbered newest first by history update date.
  3. If OrderNr is not NULL, all order comments of this order number are appended as type OrderComment (no defined order within this group).
  4. Each collected row gets a running number Offset starting at 0, in the order of collection (customer comments first, then order comments).
  5. The result returns at most RowCount rows whose Offset is greater than or equal to @Offset, sorted by Date descending.

Both filters can be combined; the comments are then merged into one result set.

Notes

  • The Offset numbering follows the collection order (customer comments by date descending, then order comments in undefined order), while the output is sorted by Date descending. With both filters set, paging via @Offset therefore does not necessarily correspond to the displayed date order.
  • SET ROWCOUNT limits the output; RowCount = 0 returns all rows.
  • The empty-check only rejects the call if both values are empty. An empty string (not NULL) for one parameter still runs that branch, e.g. CustomerNrExternal = '' searches for customers with an empty external number.
  • Offset is a smallint; more than 32,767 collected comments would cause an overflow error.
  • No NOLOCK hints are used.

Tables used

CustomersHist · Read Customers · Read OrderComments · Read
SQL object:
dbo.pipiGetComments
Updated at 2026-10-30