Can anyone help me figure out how to lock a particular record once it's opened by a user? I have built a small application that allows users to open up the "Next available customer" - determined by a query that says "If customer.dontcall = No". Once they open the next customer, they can call them and log the call into the application. Once they are done logging it in, the customer.dontcall flag is set to 'Yes' so the customer won't be brought up again.
The problem I'm having is that the "next available customer" is pulling up when User1 logs in as well as when User2 logs in. So User1 logs in, clicks to get the next customer, and makes a phone call to them. While that use is on the phone with the customer, User2 logs in and clicks to find the "next available customer". If User1 has not completed and logged his call, User2 will pull see the same customer pull up. After the call is completed, the next record pulls up (as it was intended).
Can anyone help me figure out how to handle this? I don't see any ability to use record locks here... maybe there is a work around? I've thought about putting some kind of Yes/No item in the customer object called "Locked" but I can't figure out how to trigger that to be "locked" when a user opens that record... HELP!?!?!?