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!

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.