Help with hooks

Hello all,
I need help with creating a hook and thank you in advance for the assistance.
I have a table called ‘Members’ and it has 3 fields - Name: String, Title: String and isCurrent: bool.
The idea is that members can go in and update their name or title anytime, however this will create duplicate entries by that member. My objective to have isCurrent only checked for the latest entry and then put a filter when displaying the result.
can anyone help?
thank you!

Hi,

my recommendation is that you do it in another collection named user_audit or something like that. do before doing any update to the user collection in the before update data hook

you read the current record by its ID, and insert it to the audit table, leaving the ID, createdDate and updatedDate blanks so the database will fill them for you (do not copy those fields, just your data)

Shlomi