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

Prevent a user from entering a field under X condition?

Featured Replies

Hi,

I'm trying to make a field act like a "enabled/disabled" under a certain condition. The problem is using the onObjectEnter trigger is not working or there is something I missed.

Even if the script returns false, the object gets the focus.

Here is my script


Freeze Window

Set Variable [$typeAdd; Value: 5]

if [rep_ADDENDAS::fkTypeID = $typeAdd]

   Exit Script [Result: True]

else

   Exit Script [Result: False]

End If

BTW, the script is triggered from a portal field.

Thanks for any help.

A script triggered by OnObjectEnter event runs AFTER the event has been processed, and the script result is irrelevant.

  • Author

Ok

I'm using a workaround by adding a "Go to next field" in the "else" block, but I don't like this code.

Is there a better way?

You could make the field itself a button (but then you cannot tab into it).

Edited by Guest

Ok

I'm using a workaround by adding a "Go to next field" in the "else" block, but I don't like this code.

Is there a better way?

No. Why don't you like it? That is NOT a "workaround". It is taking control, using the logic you have decided on.

  • Author

Well you know, in my opinion everything named "Go to" sounds pretty odd.

The use of "goto" in the programming world is almost prohibited :).

I don't see how you would program a user interface without using 'go to'. User presses tab, expecting to move to the next field in tab order - how do you move the focus if not by 'go to'?

That said, I agree that the solution is not perfect - but until Filemaker allows us to put more conditions in 'Allow field to be entered', the options are rather limited.

  • Author

it's true that we are quite limited.

I wonder how FM manage to keep going at this pace compared to other database system.

A lot of FM developpers are getting old and there is not much new FM enthusiast...

Anyway that's another story!

thanks for helping

A lot of FM developpers are getting old

Thanks for the reminder…

  • Author

lol! :)

  • 4 weeks later...

I resemble that remark!!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.