Record locking check before display

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Record locking check before display

Jolle Carlestam-2
Is the some param that I can set if I want to prevent opening a  
record in edit mode if it's locked by another user? As it is working  
for me now it seems as if a user can open the record, do a lot of  
editing and then first when he tries to save it get alerted that  
there's another user locking it.

That will cause grief among my users. :-)

HDB
Jolle

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop


Reply | Threaded
Open this post in threaded view
|

Re: Record locking check before display

Johan Solve-2
After getrecord the database object will return an error_code of 7010 if the record was already locked by someone else.
7010 = 'Record locked by another user'
For this error (and a few others) error_data will also be populated with a map with some info, namely the user id of the user that has locked the record and the time when the record was locked.

$db -> error_code returns 7010
$db -> error_data returns map: 'user'=#lock_user, -timestamp'=#lock_timestamp

Use this to give the right feedback to the user.

Possible error codes for database are listed around line 160 in database.inc source file.
Error codes that populate error_data are listed in local: 'errors_error_data'.


At 17.31 +0200 2007-05-25, Jolle Carlestam wrote:

>Is the some param that I can set if I want to prevent opening a record in edit mode if it's locked by another user? As it is working for me now it seems as if a user can open the record, do a lot of editing and then first when he tries to save it get alerted that there's another user locking it.
>
>That will cause grief among my users. :-)
>
>HDB
>Jolle
>
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list <[hidden email]>.
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>
>List archive http://lists.montania.se/Lists/knop/
>(log in with your email and ConfirmationID as password, send message to
><[hidden email]> to get that ID)
>Project homepage http://montania.se/projects/knop/
>AIM chatroom knop aim:gochat?roomname=knop


--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop