Currently, I am developing a system where multiple users will be logged in simultaneously. However, it is essential to ensure that two individuals cannot access the same user record at the same time. How can I prevent this from happening? For example, if the username "admin" is viewing record 123, and another user wants to access the same record, they should receive a prompt stating, "Sorry, admin is already viewing that record. Please wait until they have finished. Thank you."
What steps should I take to lock out the other user?
Here's an idea: when searching for a record in the left box and clicking on "search," the results pane on the right displays the relevant information. If a user tries to open a record that is already being viewed by someone else, a notification like the one mentioned above should appear.