I have a table A with my clients. A table B where they are registered in another service. And a copy A_backup table of the records of the first.
When a person is registered in table B (add record) then, from the "Before add" event, we search in table A if that record exists. (there is a unique field that is the DNI or VAT)
If the record that we are going to save in table B does not exist in table A, then we add it to table A. Simple. No problem
If the record that we are going to save in table B already exists in table A, then we replace the data with an update. There is no problem either.
What I want to do and I do not know how is that if the record exists we can do, before the Update to table A a backup copy of that record that is in table A in table A_backup
Sure it's easy, but I don't know how to do it. Thank you
When a person is registered in table B (add record) then, from the "Before add" event, we search in table A if that record exists. (there is a unique field that is the DNI or VAT)
If the record that we are going to save in table B does not exist in table A, then we add it to table A. Simple. No problem
If the record that we are going to save in table B already exists in table A, then we replace the data with an update. There is no problem either.
What I want to do and I do not know how is that if the record exists we can do, before the Update to table A a backup copy of that record that is in table A in table A_backup
Sure it's easy, but I don't know how to do it. Thank you