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.

Featured Replies

This must be easy to do, but I just can't think it through.

Suppose Field#1 contains the value "Yes".

Then I want to allow a user to edit "Yes" to "No".

But if Field#1 already contains "No", then I want to prevent this being changed to anything else.

I'd like to do this with minimal overhead - preferably no Script Triggers or buttons or dialogues - it should be seamless. i.e. if the user overwrites "No" with "Yes", it should revert back to "No" with no dialogue.

Is this possible ?

Thanks for your time.

I feel like this is a very common desire, but Filemaker doesn't have an easy way to accomplish this...

 

Is your case simply that one field Yes/No field?? You should just use some script triggers...Store the current field value on field enter To a $$Global Variable or a global field. Then, on field exit, have another script trigger, if Previous Value = "No" and Field1Value = "Yes"; Field1Value = "No". Each script would be a couple of lines. If you wanted you could show a dialog sending a message about reverting the field.

Which FM version? Your profile says 7 but you mention Script Triggers.

What you want is easy in FM13.

Hi Peter and welcome back.

 

A lot of changes to FileMaker since version 7, please update your profile to reflect your current information. Here is a quick link for you convenience. MY PROFILE

@hbrendel....could we see your 'easy way'?  I tend to overcomplicate things.

I came up with this script trigger for OnObjectModify, Script parameter is just the field

 

Set Variable [$$a; Value:Get(ScriptParameter)]

If [isEmpty ($$a) or $$a="Yes"]

Else

     Set Field [Table::field;"No"]  // Yes/No field

End If

Set Variable [$$a; ""]

 

I put this on a radio button set.  In this field I use RayBaudi's (where's he been?) much posted:

GetValue (Self; ValueCount (Self)) as an auto enter calc, "do not replace..." unchecked, to prevent shift+clicking both buttons

I use 'Hide Object When'.

Make two instances of the same field, One is editable, the other not. Give them complementary conditions for hiding and place them on top of each other.

The non-enterable field is hidden when the value not = "No".

The enterable field is hidden when the value = "No".

Easy in FM 13...

But if Field#1 already contains "No", then I want to prevent this being changed to anything else.

I'd like to do this with minimal overhead - preferably no Script Triggers or buttons or dialogues - it should be seamless. i.e. if the user overwrites "No" with "Yes", it should revert back to "No" with no dialogue.

 

I think the question of why you want this should come before the question of implementation costs. If this is a matter of data integrity, then it should be solved at the data layer, not by using any layout measures (script triggers, conditional formatting, etc.).

 

 

Are you really using version 7 as indicated by your profile?

Thanks Henk Brendel for your detailed explanation.  I still have 12, so I'll have to file it away in my brain.

  • Author

Sorry everyone. I'm on version 13.

This worked perfectly for my case, thank you! Very cool, I hadn't seen Hide Object When..

 

I use 'Hide Object When'.

Make two instances of the same field, One is editable, the other not. Give them complementary conditions for hiding and place them on top of each other.

The non-enterable field is hidden when the value not = "No".

The enterable field is hidden when the value = "No".

Easy in FM 13...

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.