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.

Go to Record/Request..by calculation: using variable

Featured Replies

Hi. i have a script that sets two variables. I would like to later go to a record where those variables equal a fields value (there will only be one record that equals those values. For instance:

Set Variable [$year value:"98/99"]

Set Variable [$test value:"01"]

...

Go to Record/Request/Page [MyYearfield = $year and MyTestfield = $test]

This does not seem to work. I have tried a couple of variations, but nothing has worked so far.

Can someone please help? Thanks!

I suggest that you either 1) Perform a Find or 2) a. provide globals that your Users can enter these two values or b. use your variables to set global fields which establish the proper relationship to a table occurrence of the records you want to end up with. You will join on two fields:

1) Perform a Find which would look like this:

Enter Find Mode [ ] ... uncheck Pause

Set Field [ YearField ; $year ]

Set Field [ testField ; $test ]

Perform Find [ ]

2) Create two globals (gYear and gField) and establish a new table occurrence as:

gYear = new table occurrence::Year

AND

gField = new table occurrence::Field

Then let your variables set the relationship to the globals. Script would be:

Set Field [ gYear ; $year ]

Set Field [ gField ; $test ]

Commit Records/Requests

Go To Related Record [ Only Related Values ; "new table occurrence" ]

If you need more details on either approach, let us know. Since you are only finding one record, a search might be better. But the GTRR (Go To Related Records) approach has merit as well. It would depend upon your purpose which you haven't explained.

LaRetta :wink2:

  • Author

Hi LaRetta-

Yeah i actually ended up nixing the variables and just hard coding a find for the field values. It works as i need it to.

Question though - Why can't Filemaker perform a find on a variable? It takes the variable name as a literal text string. I think that would have easily solved my problem

Finds are performed on fields. A variable isn't a field. Globals are still very-much workhorses in FileMaker ... establishing relationships and accepting User input are two of the primary uses. Of course you already knew the values (they are in variables after all). :wink2:

I'm not much for hardcoding in scripts or calculations; I'd prefer allowing as much flexibility and change for a business as I possibly can and I'll use script parameters, globals, and variables whenever possible. For instance, I'd rather use those variables in your find rather than hardcoding the variable values ... that's why they're called variables.

LaRetta

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.