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.

Preventing form submission when record 'in use' on LAN. How do i check for this?

Featured Replies

hello..

i've been looking now for 2 days on how to make a web form check to see if a record is 'in use' on the LAN (cursor in a field.. or uncommitted record).

currently, if i'm accessing a record on the LAN with someone else on the web, there's nothing to prevent that form being submitted. The obvious problem being that any changes created online are simply ignored on submission. I need to be able to check for 'in use' prior to drawing/loading the form. I could do this manually (we have a 'locked' checkbox), but that's used along with a timestamp, and set AT THE TIME of submission.

all i've found so far in the FM app is a function called "Get (RecordAccess)".. which doesn't seem to be giving me the desired behavior? Is there something i can do on the web side (PHP) that will check for 'in use'?

many thanks!

Try using:

Get(RecordOpenState)

It returns the following information:

0 for a closed or committed record.

1 for a new record that hasn't been committed.

2 for a modified record that hasn't been committed.

  • Author

Try using:

Get(RecordOpenState)

It returns the following information:

0 for a closed or committed record.

1 for a new record that hasn't been committed.

2 for a modified record that hasn't been committed.

thanks for the reply..

however, i made a calc (text) field called 'record_state':

If ( Get ( RecordOpenState ) ≠ 0; "locked" ; "open" )

i put this field on my 'web' layout in filemaker.. but when i go into a field and start changing things, i can't get this value to say "locked", even if i hop to another field (prior to committing the record). Since i can't get a value of "locked", my PHP line:

if ($attendee->getField('record_state') == 'locked') {

echo 'record in use';

}

..will never be true. I've tested this by editing an attendee field and not committing it. When i access the record over the web, my "if" statement thinks the record is "open".

not sure what i'm doing wrong yet.. :

Your commit() statement should return a Filemaker_Error object (error 301 => 'Record is in use by another user'.) if you try and write to a locked record.

Unfortunately FMP's solution to the Race Condition is less than elegant so if you have users accessing the same table in both the FM client and a web page there is no good solution. e.g. If a user accessing the db via the FM client parks a cursor in a field and goes to lunch, you could have a web user stuck on a page that says "record is locked. please wait a few seconds then click refresh" for a while.

Currently all of our web based data entry into Filemaker tables involve inserts so I haven't had to really think about this yet.

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.