Postman collection
Orders Write

pixiTagMatchDeleteForOrders

Removes tag assignments (TagMatch) from orders for the tag/order pairs passed as XML and returns one status row per pair.

Deletes the assignment of order tags to orders. The pairs are passed in TagsXML; every Tag element below /Tags/Order/TagList is one request entry.

Steps:

  1. The XML is read element-centric. For each Tag the TagId is taken from the Tag element, OrderId and OrderNrExternal from the parent Order element. A TagId or OrderId of 0 and an empty OrderNrExternal are treated as missing.
  2. The order is resolved in OrderHeader: by OrderNr = OrderId and by OrderNrExternal. The order header key found via OrderId takes precedence; if none is found, the key found via OrderNrExternal is used. If only OrderNrExternal is given, the returned OrderId is the OrderNr of the matched order.
  3. Each entry is validated:
    • no TagId, or neither OrderId nor OrderNrExternal → Error Mandatory parameter is missing
    • order not found, or tag not found as an order tag (Tag.TypeId = 2) → Error One of the provided values is not valid
  4. For valid entries an existing TagMatch row with this tag and order header is looked up. If it exists, the entry gets Success Tag was successfully removed from order and the TagMatch row is deleted. If it does not exist, the entry gets Warning Tag is not assigned to that order.
  5. One result row per entry is returned, sorted in the order of the entries in the XML.

Notes

  • Only tags with TypeId = 2 (order tags) are considered.
  • The call runs in its own transaction, or in a savepoint if a transaction is already open.
  • If an unexpected error occurs (e.g. malformed XML), the transaction is rolled back, the error is logged via log.InsertError (not attached) and no result set is returned. The text Unexpected error: "…" is built internally but not selected.
  • Lookups in OrderHeader, Tag and TagMatch use NOLOCK; the delete uses ROWLOCK.
  • If several orders share the same OrderNrExternal, the entry can produce several result rows and the tag is removed from all matching orders.
  • The same tag/order pair listed twice returns Success for both entries; the TagMatch row is deleted once.
  • The header comment of the procedure says Create TagMatch for Order, but the code only deletes assignments.

Tables used

OrderHeader · Read Tag · Read TagMatch · Write
SQL object:
dbo.pipiTagMatchDeleteForOrders
Updated at 2026-10-30