NetTalk Central

Author Topic: Is there a strategy to "undelete" (an OOPs button?)  (Read 3850 times)

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Is there a strategy to "undelete" (an OOPs button?)
« on: May 06, 2012, 01:23:00 AM »
Sure enough, the customer deleted a parent record (with cascaded action child records).  Yep, they clicked the "OK to Delete" button and immediately said "OOPs" as the parent and all child records disappeared.  OK, it is their fault, but.... it is now my problem.

So, is there a "best practice" or strategy in a NT6 environment for a customer initiated "OOPs" to restore the missing records - I mean short of a backup/restore.

Or, do I do something like just mark "deleted" records and in all my procedures filter out "delete marked" records but allow the "OOPs" to give them access to copy a selected marked record back to the active database?

Just looking for a best practice.
Thanks,
Mike

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11298
    • View Profile
Re: Is there a strategy to "undelete" (an OOPs button?)
« Reply #1 on: May 06, 2012, 02:37:41 AM »
Hi Mike,

I guess this is a general question, because it's not related to Nettalk apps, but rather to any app, Web or Windows.

On the one hand, yes, backups are an option. And in most cases are pretty much the only option "out the box". Whether you need a more advanced option I guess depends on how often your clients plan to delete records which they shouldn't be deleting. In no particular order, here are some suggestions;

a) don't give them a delete button in the first place. For some tables - especially lookup-tables, and invoices, they're not necessary for most users anyway. Coupled with this idea, you might limit delete buttons to a very small subset of users.

b) Don't actually "delete" records when they press the delete button. Instead change the action to "change" and set a "deleted" flag. Then set your browse to usually filter out "deleted" records. In NetTalk you can do this in the ValidateDelete embed point - setting ans to net:ChangeRecord, and setting the flag field to 1.

c) moving deleted data to an "archive" file. Usually easiest if you're using a SQL backend, as you can construct a SQL statement to re-insert the records you are deleting.

d) Tell the client not to be a moron... That's what "Are you sure you want to delete this record" is for? Charge a lot to recover the data from a backup.

Cheers
Bruce



springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Is there a strategy to "undelete" (an OOPs button?)
« Reply #2 on: May 06, 2012, 03:49:42 AM »
Thanks Bruce,
I personally like (d) Tell customer not to be a moron!  :-)

And thanks for the specifics on the NetTalk embeds for implementing the "deleted" flag.  That is the more sane approach to moron proof the app and give them an "OOPs" selection to be able to view and "reload" the "deleted" record.

Mike