This is a migrated thread and some comments may be shown as answers.
Logical Delete: support or workaround?
3 Answers 34 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrea
Top achievements
Rank 2
Andrea asked on 23 Oct 2009, 11:12 AM
Hi,

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

Sort by
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.


Best wishes,
Zoran
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jeremy Mann
Top achievements
Rank 1
answered on 22 Nov 2009, 10:16 PM
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!
0
IT-Als
Top achievements
Rank 1
answered on 23 Nov 2009, 08:10 AM
Hi Jerymy,

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.

Regards

Henrik
Tags
General Discussions
Asked by
Andrea
Top achievements
Rank 2
Answers by
Zoran
Telerik team
Jeremy Mann
Top achievements
Rank 1
IT-Als
Top achievements
Rank 1
Share this question
or