Topic: Audit trail

Hi everyone

I know this is a big ask....is there a way to create an audit trail for a database that could display in a grid or even in a report? Similar to the user grid that shows last login etc.

I am creating an HR application and I would like to be able to see which user created/updated/deleted a record. Im a beginner at SQL and dont know Pascal.

Is there a way to create this in MVD?

Re: Audit trail

Everything can be done, but what cannot be done takes more time smile


There is no such built-in functionality. But...
You can add scripts everywhere that would keep track of user actions, writing them into tables created for this purpose.
If you are using MySQL, then you can write triggers and add them to the database.

Визуальное программирование: блог и библиотека.

Re: Audit trail

Thank you smile

I'll have a look for some scripts as a starter and see if I can make it work.

Re: Audit trail

Hi ColinTrent, Hi Konstantin,
As Konstantin said, there are different approaches you could take. 
Attached is a very simple example of how you might approach it.  You can make it pretty flexible and choose whether you want to audit ALL changes or just the critical ones (such as salary, bank details (all the usual culprits!), whether you just log the change or want to do a 'before and after' comparison etc.
And if you need to see who made the changes, it would certainly be advantageous to switch on 'role based access control' in your data schema.
In the example, the passwords are the same as the userids)
Shout out if anything's unclear.

Post's attachments

Attachment icon example audit log.zip 341.21 kb, 88 downloads since 2022-11-04 

Re: Audit trail

Thank you Derek. This is going to help so much