Postman collection
Customers Read

pixiShowSpecialCommentCustomers

Returns customers with a customer history note (CHisNote) together with their invoices, optionally filtered by an invoice number.

Reads customer account entries (CustomerAccount) and joins the customer, the invoice and the invoice currency. Each row of the result is one customer account entry.

The call works in two modes:

  • InvoiceNr given: returns the entries whose invoice has exactly this invoice number. The customer note CHisNote is not checked in this mode, so customers without a note are returned as well. No sort order is applied.
  • InvoiceNr empty or omitted: returns all entries whose customer has a non-empty CHisNote and whose invoice has a non-empty invoice number. The rows are sorted by invoice date, newest first (InvDate DESC).

The number of returned rows is limited by Rows (default 300). An empty string for InvoiceNr is treated like NULL, and a NULL value for Rows is replaced by 300.

Notes

  • The row limit is applied with SET ROWCOUNT. Passing Rows = 0 therefore removes the limit and returns all matching rows, which can be slow on large databases.
  • All tables are read WITH (NOLOCK); uncommitted data may appear.
  • Although the joins are LEFT JOINs, the WHERE conditions on the invoice (and in list mode on the customer) make them behave like inner joins: entries without invoice are never returned.
  • CHisNote != '' excludes customers whose note is NULL.
  • If a customer account has several entries referring to the same invoice, that invoice appears several times.
  • Addresses is joined but none of its columns is returned.
  • According to the header comment, the call was created for a specific customer project (ticket PC-95).

Tables used

CustomerAccount · Read Customers · Read Invoices · Read Addresses · Read Currency · Read
SQL object:
dbo.pipiShowSpecialCommentCustomers
Updated at 2026-10-30