Jump to content

Users not being able to edit page at the same time


twsowerby

Recommended Posts

I ahve a call referral system that allows a user to log in and view referral records one at a time. The user looks at the record, makes a call, adds a note and clicks submit. The record is then updated.

 

I am fast approaching a situation where I will have more than one user. Given the way the system retrieves records it is possible that two people using the system at the same time may be shown the same record and attempt to edit the same record at the same time.

 

To get around this I was planning on implementing a random selection function. The function would randomly select a record and display it. Upon selection, a 'currently being edited' marker would be placed against that record.

 

The next time a user calls the random selection function, it will do a check to see if the 'currently being edited' marker exists for that record. If it does then call the random select function again and so on until it gets one with no marker.

 

Is there a better way of doing this?

 

Cheers!

Link to comment
Share on other sites

thats pretty much what I figured

 

Not entirely:

 

The next time a user calls the random selection function, it will do a check to see if the 'currently being edited' marker exists for that record. If it does then call the random select function again and so on until it gets one with no marker.

 

My method avoids this second call.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.