How to recover deleted record.

Viewing 6 reply threads
  • Author
    Posts
  • January 16, 2020 at 3:14 PM #39287

    Jonathan Levin
    Participant

    Hello.

    On occasion I accidentally delete a record (Command-Delete). There apparently there is no way to Edit>Undo Delete record. There is just an option for delete entry.

    Is there a way to recover a record that has been (acciidently) deleted right after the accident?

    This is really the only thing that makes me crazy using TF.

    Thanks.
    JL

    January 16, 2020 at 5:39 PM #39288

    Sam Moffatt
    Participant

    On the Mac under the File menu there is a “Recover Deleted Items” that might allow you to get back the record you deleted. There is usually a warning that deleting a record isn’t undoable though, you can go into preferences and reset warnings to get prompted before you delete a record.

    January 16, 2020 at 7:03 PM #39291

    Jonathan Levin
    Participant

    The recover deleted items was confusing and didn’t have the record.

    So I guess what I’d like to see is something like Edit>Undo Delete, in the event of an accidental delete. I don’t code so i don’t know how involved this would be.

    January 17, 2020 at 12:17 AM #39297

    Brendan
    Keymaster

    Hi Jonathan,

    Unfortunately it’s a complicated thing to provide undo for deletions. The Recover Deleted Items was my attempt, but it’s not always successful. And it’s definitely not successful if you compact the database. Because that throws away all the old revisions of the object in the database.

    I suppose one way to handle this would be never to delete anything. To simply mark objects as having been deleted but don’t actually delete them and don’t fetch ones that have been marked as deleted. Then when you undo, I would just flip the is_deleted bit and the record would be restored. I’d have to modify the Compact Database routine to purge records that have been marked as deleted. In reality though the Compact Database function already does this, but at a lower level based on how CouchbaseLite manages its record.

    So it’s a fairly big job, but certainly doable at some point.

    January 17, 2020 at 10:15 AM #39302

    Jonathan Levin
    Participant

    Hi Brenden,

    I could have guessed that something that sounds simple is in fact complicate to achieve. Most of the time my deletes are intentional, but for those times when I hit command-delete but want to immediately restore, the Undo would be great.

    I’ll be careful. But that would be cool to have that sometime.

    Thanks.
    JL

    January 17, 2020 at 2:33 PM #39304

    Sam Moffatt
    Participant

    Instead of a deleted flag, perhaps an expire date field which after a configurable amount of days a record might be purged? That way you can undelete a record but it still gets cleaned up eventually (configuration setting for how long to retain plus a UI to restore or permanently delete).

    January 19, 2020 at 5:57 PM #39307

    john cesta
    Participant

    what if you just had a default field hidden in the record and when someone chose to delete a record tapforms simply set that field?

    J

Viewing 6 reply threads

You must be logged in to reply to this topic.