Logical Delete: support or workaround?

Thread is closed for posting
4 posts, 0 answers
  1. Andrea
    Andrea avatar
    74 posts
    Member since:
    Jan 2005

    Posted 23 Oct 2009 Link to this post


    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
  2. Zoran
    Zoran avatar
    534 posts

    Posted 28 Oct 2009 Link to this post

    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,
    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.
  3. Jeremy Mann
    Jeremy Mann avatar
    23 posts
    Member since:
    Jul 2009

    Posted 22 Nov 2009 Link to this post

    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!
  4. IT-Als
    IT-Als avatar
    381 posts
    Member since:
    Sep 2008

    Posted 23 Nov 2009 Link to this post

    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.


Back to Top