record lock

Post Reply
digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

record lock

Post by digitalphotoworld »

It would nice to have a record lock. With this, it would not possible that two users edit a record at the same time.

It should work like this:
Each table that have a record lock, needs two additional fields. One field that contain the ID of the user that just edits the record and one field for the time when the record will unlock.

In page setup must be a new field that contains the time in seconds/minutes a record could locked. For example 15 minutes.

When a user edits an record, the fields for userid and locktime will updated immediately. It would nice if a javascript warns the user short bevor the locktime is over, so the user can save his work.

If a record is locked and a second user is trying to edit the record, there should be a message like: "Sorry, edit is not possible - the record is locked by another user". There should be an option to add to this message the name of the user and the locktime.

The record lock must work with multi-update!!!


mobhar
User
Posts: 11660

Post by mobhar »

Since you need two additional fields in the table, then this should not be handled from PHPMaker side.

However, if you want to implement such business-logic, then you may simply use "Row_UpdateConflict" server event for this purpose. Please read "Server Events and Client Scripts" from PHPMaker Help menu for more information.


Post Reply