I have a user registered on my system using the function: Usersettings();
Everything that this user registers in the system leaves his user code recorded, so that we can identify who made the necessary registration;
However, when I am excluding these Users because they are no longer part of the company, it turns out that in the other tables, that record is orphaned by a registrar. Only the code of that deleted user will be displayed, instead of their identification;
My main objective would be to create a way in which, when deleting this user, the system would ask me if I would like to assign all of this user’s records to any other user. This way, an (INPUT) box would open allowing another user to be selected, so that all the codes of the deleted user would be replaced by the code of another selected user.
Thank you very much for your precious time dedicated to this urgent matter of mine!
Sorry friend chansol. But I didn’t understand your answer. I think this is something very interesting, including for other people to be able to take advantage of this very useful automation, by the way.
I understood your idea. It’s almost correct. But the problem is bigger lol… It’s about not changing the existing user code with the deleted one. It involves assigning the EXISTING USER code to all previous registrations made by the deleted User.
In short: All existing references to records made (in several tables) by the user to be deleted, will have to point to another existing user who will become the owner of the records made by the deleted user.
For example: You are going to delete a user from Wordpress, the system asks you: Who do you want to assign this user’s publications to?