Postman collection
Items Read

pixiGetEKPriceHistory

Returns the history of purchase (EK) and sales prices from the item history, optionally filtered by item number and date range, with paging.

Reads price history records from ItemsHist and returns them page by page.

Filters

  • ItemNrInternal: if not empty, only history rows whose internal item number (ItemNrInt) equals this value are returned. Empty or NULL returns all items.
  • FromDate / ToDate: filter on UpdateDate (inclusive on both ends).
    • both set: UpdateDate between FromDate and ToDate
    • only FromDate: UpdateDate >= FromDate
    • only ToDate: UpdateDate <= ToDate
    • none: no date filter

Sort order and paging

  • Rows are numbered with RowNumber (starting at 1) ordered by UpdateDate, then item key, then purchase price, all ascending (oldest change first).
  • Only rows with RowNumber between StartRow and StartRow + RowCount (both inclusive) are returned, sorted by RowNumber.
  • RowCount = 0 is treated as 100.

For each history row the current supplier number (SupplNr) is joined from the item master Items.

Notes

  • Paging overlap: the page range is inclusive on both ends. With StartRow = 0 and RowCount = 100 rows 1–100 are returned; with StartRow = 100 rows 100–200 (101 rows) are returned, so consecutive pages share one row unless StartRow is advanced by RowCount + 1.
  • A code comment mentions a fallback of 1000 rows, but the code actually uses 100 when RowCount is 0.
  • The empty-string default of the datetime parameters is converted to 1900-01-01; passing exactly that date is treated as "no filter".
  • ToDate is compared including the time part. A date without time (e.g. 2024-06-30T00:00:00) excludes changes later that day.
  • History rows with NULL in UpdateDate or ItemNrInt are never returned, because the filter conditions are always evaluated.
  • SupplNr is the supplier currently stored in Items, not the supplier at the time of the change; it is NULL if the item no longer exists.
  • No NOLOCK hints are used. Without an item filter the numbering runs over the whole history table, which can be slow on large data sets.

Tables used

ItemsHist · Read Items · Read
SQL object:
dbo.pipiGetEKPriceHistory
Updated at 2026-10-30