Postman collection
General Write

pixiTagDelete

Deletes a tag, identified by its ID or by type and name, and removes all of its assignments to items or orders.

Deletes one tag from Tag together with all of its assignments in TagMatch. Tags are used to label objects such as items (Artikel) or orders (Aufträge).

The tag can be identified in two ways:

  • by TagId, or
  • by the combination of TypeId and Name. Both values are required together.

The parameters are checked in this order:

  1. If all three parameters are missing, or only one of TypeId and Name is passed, the call returns an error about missing mandatory parameters.
  2. If TagId is passed but no tag with this ID exists, the call returns Tag does not exist.
  3. If TagId is not passed and no tag matches TypeId and Name, the call also returns Tag does not exist.
  4. If the tag found is a system tag (IsSystemTag = 1), it cannot be deleted.
  5. If TagId and TypeId/Name are all passed and point to two different tags, the call returns an error.

If all checks pass, the call first deletes every TagMatch row of the tag, which removes the tag from all assigned objects. It then deletes the tag itself. The call always returns a single row with Status and Message.

Notes

  • The call runs in its own transaction. If a transaction is already open, it uses a savepoint instead. On an unexpected error the changes are rolled back, the error is logged via log.InsertError and Status = Error is returned with the first 80 characters of the SQL error message.
  • Errors are never raised as SqlMessage. Always evaluate the Status column.
  • Pitfall: if TagId is passed together with a TypeId/Name pair that matches no tag, the conflict check does not apply. In that case the tag with TagId is deleted.
  • Passing TagId together with only TypeId or only Name returns the missing-parameters error, even though TagId alone would be enough.
  • The checks read Tag with NOLOCK. The deletes use ROWLOCK.
  • The meaning of the TypeId values (for example item or order tags) is not defined in this code.

Tables used

Tag · Write TagMatch · Write
SQL object:
dbo.pipiTagDelete
Updated at 2026-10-30