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.
3 Answers, 1 is accepted
answered on 28 Oct 2009, 05:09 PM
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.
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.