Postman collection
Suppliers Write

pixiSetHistoricalSupplierPrice

Updates the supplier price and supplier of a historical inbound price record (InvBinItemLog_In_Price) that has no delivery assigned yet.

Manually sets the supplier price of one historical (FIFO) inbound price record, identified by InvBinItemLogId.

Steps:

  1. All four parameters are mandatory. If any of them is missing, an error row is returned.
  2. A negative SupplierPrice is rejected.
  3. SupplierId must exist as SuppliersKey in Suppliers.
  4. UserName must exist as USER_NAME in UCS_USERS. The matching user ID is stored as the modifying user.
  5. The record InvBinItemLogId must exist in InvBinItemLog_In_Price.
  6. Only records without a DeliveryId can be changed. Records already linked to a delivery are rejected.
  7. The record is updated:
    • Price is set to SupplierPrice.
    • SupplierId is set to SupplierId.
    • DeliveryId and DeliveryId_Assigned are set to NULL.
    • QuerySource is set to 5 (manual update via API).
    • RecordModifiedByUserId and RecordModifiedOn are set; the timestamp is the current time as smalldatetime.

The call returns exactly one row with a status and a message, either an error or a success confirmation.

Notes

  • Column name pitfall: Validation error rows use the column Status. The success row and the error row from the CATCH block use the misspelled column Staus. Clients should check both column names.
  • The header comment of the procedure ("Returns FIFO supplier prices") does not match its behaviour. The procedure updates data.
  • The procedure opens its own transaction, or a savepoint if the caller already has an open transaction.
  • The validation checks return before a commit or rollback. If no outer transaction exists, the call can end with the transaction still open. SQL Server may then report a transaction count mismatch.
  • If a runtime error occurs, the transaction or savepoint is rolled back. The error is logged via log.InsertError (not attached).
  • Lookups use NOLOCK. The update uses ROWLOCK.
  • In the success message the price is formatted as money cast to varchar, i.e. with two decimal places.

Tables used

Suppliers · Read UCS_USERS · Read InvBinItemLog_In_Price · Write
SQL object:
dbo.pipiSetHistoricalSupplierPrice
Updated at 2026-10-30