Hello TMS Support,
we are using TMS Aurelius together with TMS XData automatic CRUD endpoints.
We have a requirement where some entities should not be physically deleted from the database when the client sends an HTTP DELETE request. Instead, those entities should be moved to a trash state by setting fields like PAPIERKORB = True, GELOESCHT_AM, and GELOESCHT_USER.
Ideally, we would like to keep using the standard Aurelius/XData delete flow, especially TObjectManager.Remove and the automatic XData CRUD DELETE endpoints, so clients can continue to use the normal REST semantics.
We looked at Aurelius OnDeleting / XData OnEntityDeleting, but those events appear to be notifications only. They allow us to inspect the entity before deletion, but we could not find a supported way to mark the event as handled/cancelled, perform an update instead, and still return a normal successful 204 No Content response to the client.
Our questions are:
Is there an official supported way to intercept TObjectManager.Remove and replace the physical DELETE with an UPDATE for selected entity classes?
Is there an official way in XData to override the automatic CRUD DELETE behavior for selected entity sets, without writing separate service operations for every entity?
If this is not supported, what is the recommended architecture for implementing soft delete/trash behavior with Aurelius entities exposed through XData?
Would using service operation route overrides with RoutingPrecedence = TRoutingPrecedence.Service be the intended approach?
Are there any caveats regarding cascades, entity destruction/detaching, filters, or Where/global filters when implementing soft delete this way?
The reason we need this is data safety and auditability: many business objects should be restorable from a trash view and should keep deletion metadata, while some other technical or child entities may still need to be physically deleted.
Thank you.