I would know if Logical Delete support is in your future plans or if there is now a viable workaround to use OpenAccess in logical delete scenarios.
Best Regards
3 Answers, 1 is accepted
0
Zoran
Telerik team
answered on 28 Oct 2009, 05:09 PM
Hi Andrea,
This has not been on our TO-DO list yet, but our team will evaluate it as a feature request and there is a possibility that we put it in our plans for the future. For now the only way to achieve logical delete is by handling the case by yourself. One of the workarounds is instead of deleting an object, one should just move it to another table. This operation can be done by subscribing to the deleting event and do the copy to the table where you would keep the deleted records there prior to the deletion.
I'm also in Andrea's position. I need to logically delete items, but due to reporting dept constraints I cannot move the data to a different table.
How would I go about overriding the OpenAccess delete methods to just update my "IsActive" columns to false (preferably on a per object level). Thanks!
This is a "shot in the wild" but have you looked at the ITracking interface?
My idea was to opt in on the Removing or Removed event and in that handler first perform a refresh (Refresh method) of the persistent object and then write to the field you have for deciding whether this object is deleted (for example: a discontinued bool type field).
What I don't know is whether OA will stall on refreshing and changing the object while it is about to perform a delete and whether it just performs the delete anyway...
Another way (I have done so) is to let "business logic" decide whether it is an object that must not be removed and thus just marked as discontinued.