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

Hi guys

Hoping for some intellectual input from those more experienced than I.

I am trying to create a "portable tick box"

By this I mean a script that I can attach to any field to make it a tick box

So far I have created a number field and set it to display all non zero values as a tick.
I have then attached a scriptrigger which runs a script on entering the field

The script is as follows:  Set Field by Name [Get (ActiveFieldTableName)& ::" & get (ActiveFieldName);Abs (Get (ActiveFieldName)& "::" & get (ActiveFieldName)-1)]

 

This way if the field is empty it will be set to 1 and if it isn't it will be set to zero.

So far, when I click into the field it correctly sets it to 1 and displays the tick but it remains at 1 and won't zero which I don't understand.

 

Can anyone see the flaw?

 

Joseph

Get (ActiveFieldName)

gets the field's name. You want to modify the field's value, so set the field to =

Abs ( Get ( ActiveFieldContents ) - 1 )

or simply =

not Get ( ActiveFieldContents )

 

  • Author

Awesome. This works really well.

I notice though that by using this method, that the 1 or 0 becomes momentarily visible before seeing the tick

If I set the field directly ( set field rather than set fieldbyname) that the 1 or zero is not displayed

2 minutes ago, eyedoctor said:

I notice though that by using this method, that the 1 or 0 becomes momentarily visible before seeing the tick

That is the nature of the hack you have devised: a script triggered OnObjectEnter runs after entering the field - and while a field is active it will display its contents unformatted. If you use a button instead, the field won't be entered at all and you won't see the raw contents.

What is the purpose of these boxes?

 

  • Author

They are just tick boxes.

Look better than the native Filemaker ones.

Problem with attaching a script, is that the field is not entered and so the Get(active fieldname) won't work because the field is never active

1 hour ago, eyedoctor said:

Problem with attaching a script, is that the field is not entered and so the Get(active fieldname) won't work because the field is never active

That is correct: you need to use a script parameter to identify the field. Or attach a single-step action to each button.

  • Author

I like the idea of the single step action, but how would this work?

You would have to define each button individually, with the specific field being hard-coded in the Set Field[] script step.

  • Author

I think that in the end, this is probably a better and simpler approach.

Thank you for your advice

 

Joseph

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.