Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Record locking...pls help

Featured Replies

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

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).

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.

  • Author

Thanks guys. I now got the idea.

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

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.