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.

Combined AND / OR searches

Featured Replies

I'm having trouble scripting a combination AND OR search using FileMaker7.

For example: A search for all records where Parameter_1 is A or B or C, AND where Parameter_2 is 1 or 2 or 3. Done correctly, this should find those records matching all nine permuations of the search criteria (A1, A2, A3, B1, B2, B3, C1, C2, C3).

Hope this makes sense. Any advice?

Thanks for your help,

Michael

Do a perform find script step for the first set of OR's then follow that by a contstrain found set step for the second set of OR's. For the OR's use the add new request for each OR required. Rather than scripting by keyboard perform the first find using the proper layout in find mode, then go into the script select the perform find step and the parameters you just used should show up in the menu. Do the same for the contrain step.

Rod

ANDs use the same request, ORs use new request. Thus you will need 9 requests. Your script will look something like this:

Enter Find Mode []

Set field [1, "A"]

Set field [2, "1"]

New request

Set field [1, "A"]

Set field [2, "2"]

New request

Set field [1, "A"]

Set field [2, "3"]

New request

Set field [1, "B"]

Set field [2, "1"]

New request

Set field [1, "B"]

Set field [2, "2"]

New request

Set field [1, "B"]

Set field [2, "3"]

New request

Set field [1, "C"]

Set field [2, "1"]

New request

Set field [1, "C"]

Set field [2, "2"]

New request

Set field [1, "C"]

Set field [2, "3"]

Perform Find []

You can use Duplicate Record/Request to streamline it.

Enter Find Mode [ ]

Set Field [1, "A"]

Set field [2, "1"]

Duplicate Record/Request

Set field [2, "2"]

Duplicate Record/Request

Set field [2, "3"]

Duplicate Record/Request

Set field [1, "B"]

Duplicate Record/Request

Set field [2, "2"]

Duplicate Record/Request

Set field [2, "1"]

Duplicate Record/Request

Set field [1, "C"]

Duplicate Record/Request

Set field [2, "2"]

Duplicate Record/Request

Set field [2, "3"]

Perform Find [ ]

  • Author

Ralph's method works, but I need something more flexible, since users will be entering their own combinations of values.

Rod's method works perfectly, but I need to automate this with a script. Is there a way to perform or simulate "add new request" in a script?

---------------

Thanks,

Michael

You can have the search done in Browse Mode using globals. Then use the script steps above, substituting your global field names for A, B, C, 1, 2, 3 (and don't use quotes).

New Record/Request is the step you seek.

  • Author

The script works! The "New Record/Request" step was exactly what I needed to make this work. Thanks everyone.

-----------

Michael

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.