databaseManager.getEditedRecords --> deleted records

Hi,

The function getEditedRecords() returns all the records with outstanding data.
But i also need the deleted records, which it doesn’t return.

Is there a function which will return the deleted records?

Hi Jos,

You don’t see the deleted records because they are in fact already deleted from the database. Autosave off or not it doesn’t matter.
Hence the advice floating around to instead flag your records as deleted using an extra column. Or to use a database transaction where you can rollback your deletes.

Ok thanks,

I use the getEditedRecords to log changes made by a user.
So if I understand it right, it isn’t possible to use that for logging deleted records.

But will it appear if I use the databasemanager.Transaction ?

Hi Jos,

Only the not-saved records will show up in the getEditedRecords. Since deleted records are ‘saved’ immediately they won’t show up in there.
A database transaction is something that is all done in the back end database itself and it keeps track of everything done in that transaction. When you commit this transaction then all changes are made permanent and visible to other connections/users. When you rollback then all the saved changes are undone.
If you want to keep track of a delete I suggest you use a table event for that.