garrys Posted December 30, 2005 Posted December 30, 2005 Hi all, Is it possible to restrict a user from making changes on a record(all fields) being viewed by another user? So that only the user who first open the record will be able to make changes. Thanks in advance for any clue. Garry
CyborgSam Posted December 30, 2005 Posted December 30, 2005 Am I answering the right question? FileMaker has built in multiple-user record locking. The Open Record script step locks the record for that user, disallowing other users from editing the record. Also, the first user to click in a field for a record automatically opens that record, locking out other users (who get a record bust message from FileMaker).
Wim Decorte Posted December 30, 2005 Posted December 30, 2005 If the first user is just viewing then the record will not be automatically locked. What you can do is set a flag field whenever someone navigates to the record. All navigation scripts that go to that record would check for the flag.
CyborgSam Posted December 31, 2005 Posted December 31, 2005 If the first user is just viewing then the record will not be automatically locked. What you can do is set a flag field whenever someone navigates to the record. All navigation scripts that go to that record would check for the flag. IMHO, FM7/8's Open Record/Request script step's record locking is easier to use and is guaranteed not to have "concurrency" (multi-user real-time) issues. It is also FileMaker's recommended method of assuring record locking. The Open Record/Request requires an error check: Open Record/Request If [( Get ( LastError )] For the flag method, testing the flag alone is not adequate (see geek-speak below), an error check must be done after a Set Field step: Set Field [n_RecBusy? ; 1 ] If [( Get ( LastError )] IMHO, the Open Request is more intuitive and self-documenting than Set Field. The reason checking the flag alone is not adequate is concurrency. Here's an example scenario. With the flag for a record cleared, two users click the same button to open the same record at the same time. The button script has this test: If [ n_RecBusy? ] User 1's script executes first, the If statement is false, so user continues to the next script step. At that exact moment, FileMaker "multitasks," pausing user 1's script and executing user 2's script. User 2 also passes the If test because user 1 has not yet set the field. So both users have passed a test supposedly allowing a single user...
Recommended Posts
This topic is 6901 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now