Postman collection
General Read

pixiImportFindXML

Returns the most recent XML import log entry for an order (by ORDER_ID) or an item (by SUPPLIER_AID).

Searches the XML import log C_XMLLog for the latest entry that contains a given ID and returns it with request, response and status information.

  1. If Id is empty or NULL, a status row with StatusCode 400 is returned and nothing else happens.
  2. Type is compared case-insensitively:
    • order: looks up the operation type OrderImport in C_OperationTypes and searches log entries whose XmlResponseXml contains an ORDER_ID element (at any depth) whose value equals Id.
    • item: looks up the operation type ItemImport and searches for an SUPPLIER_AID element (at any depth) whose value equals Id.
    • Any other value returns a status row with StatusCode 400.
  3. Additional filters for both types:
    • If Channel is given, only entries with that ChannelRef are considered; if it is NULL, all channels are searched.
    • Entries with Status = XNI are excluded.
  4. The result is sorted by XMLLogKey descending and only the first row (the newest matching log entry) is returned. If no entry matches, the result set is empty.

Notes

  • All reads use NOLOCK, so uncommitted log entries may be returned.
  • The ID match is an exact string comparison against the element value inside XmlResponseXml using an XPath exist() with a descendant search (//). This is evaluated for every candidate log row and can be slow on large log tables; using Channel narrows the search.
  • The Id check happens before the Type check, so an empty Id always yields the ID error message even if Type is invalid.
  • If the operation type OrderImport or ItemImport does not exist in C_OperationTypes, no rows are returned.
  • The meaning of the status value XNI is not defined in the code.
  • Response is the XML column XmlResponseXml converted to varchar(max).

Tables used

C_OperationTypes · Read C_XMLLog · Read
SQL object:
dbo.pipiImportFindXML
Updated at 2026-10-30