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

I'm sure I am missing something really simple here so apologies for the level of this question.

I have a form which details transactions. I'd like to select all transactions for a particular year. If I go into find mode, it's easy (I enter the year I want and up pop all the related records. However, I want to do it with a button so the user picks the year from a drop-down and then on the button press it finds all related records to that button press.

My difficulty is I cannot see how to pass the variable from the year selection to the find script. I can run a find script that pulls back the records where year = 2008. What I cant work out how to do is run a script that pulls back the records where year=yearchoice (where yearchoice is the input field)

Help!

Cheers

TattyDon

Edited by Guest

Create a global field so that the users can enter in the year.

Then you can use a script like this:


If [ IsEmpty (gYearinput) ]

Show Custom Dialog [ "Please enter in a year" ]

Else

Set Error Capture On []

Enter Find Mode []

Set Field [ YourDate; Date ( 1; 1; gYearinput ) & "..." & Date ( 12; 31; gYearinput ) ]

PerForm Find []



If [ not Get ( FoundCount ) ]

Show Custom Dialog [ "No Records Found" ]

End If



End IF

  • Author

Thanks for this - I'm a bit confused by the Set field line:

Set Field [ YourDate; Date ( 1; 1; gYearinput ) & "..." & Date ( 12; 31; gYearinput )

Whats the 'YourDate' Date bit here and what are the numbers doing here? If it might make it easier, the have a field called 'Year' which pulls the year out of the date field and is therefore the one I want to compare against

Cheers

JL

Well if you already have a field that returns the year for each record, then you wont have to look for a date range for the year.

You can just change the set Field to:

Set Field [ YourDateYEAR; gYearinput ]

Another method is:

You can create a relationship keyed from the gYearInput field to YourDateYEAR field. Then you can use Go to Related Records instead of using a find at all.

Can you use */*/gYear rather than the range?

Can you use */*/gYear rather than the range?

Yes. Technically, you can even just set the field with gYear by itself. Since its a date field, FileMaker will recognize that you are looking for a year and fill in the */*/ for you.

Enter Find Mode []

Set Field [ YourDate; gYear ]

Perform Find []

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.