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.

How to get field contents when using the field as button?

Featured Replies

Hi!

 

This is a stupid problem but I just cannot figure out how it works.

 

I've created a small calendar where each day is shown in it own field. Each month the contents of the fields are calculated and placed to correct field so that if the first day of the month is Monday, it is placed to the first field. If the first day of month is wednesday, it is placed to third field etc. (please see the picture). Each of these boxes are named objects.

 

Then I defined each "box" as a button which starts a script and copy the date in the field to a variable $date (Set Variable [$date; Value:Get (ActiveFieldContents]).

But for some reason I get nothing out of it. 

 

 

What I do wrong?

 

Kind regards,

R2D2

post-60806-0-79141700-1407139389_thumb.p

What I do wrong?

 

If you define the field as a button, this automatically preclude field access – so there is no active field from which to read the contents. A workaround is to allow field entry and fire the script with an OnObjectEnter trigger; read the contents, then commit the record.

 

I've created a small calendar where each day is shown in it own field.

 

I suggest you use a repeating field for this, thus eliminating an overhead of 41 fields with one fell swoop; also, if you'd define the field as a calculation and use Get ( CalculationRepetitionNumber ), each repetition could calculate its own date.

  • Author

Hi !

 

Thank you for a quick reply! I actually worked around this problem by using an individual ScriptParameter with each of those buttons. As far as I know the Script Triggers don't work when you access the database via web browser and that's why I try to avoid them.

I actually worked around this problem by using an individual ScriptParameter with each of those buttons.

 

I was just about to suggest the very same thing.

 

I would also steer you toward a repeating calculation field - see, for example:

http://fmforums.com/forum/topic/42617-basic-monthly-calendar-april-06/?p=200289

 

You do know, of course, that Filemaker has a built-in drop-down calendar, right?

  • Author

Oh, yes I know there is a built-in calendar, but it is so small and I need a bigger calendar. I try to make a solution which manages working shifts and builds duty roster. Every employee has days when they want to be on duty and when definitely not. It is always a huge task to make next months duty roster when you have abt 100 employees and 5 positions which have to be manned 24/7. And at the same time respect employee's wishes.

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.