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.

Simple "OR Search"

Featured Replies

Hi everyone,

I’d be grateful if someone could help me with a Boolean "OR search".

I would like to offer my users a possibility to simply key in a phrase like searchtermA OR searchtermB when they search for different values in one field. Using Extend Found Set is way too complicated in my humble opinion. On top, I am very restrictive when it comes to giving access to menu options. Accessing Extend Found Set from the menu bar is not available for my users.

I guess I have to write a nice script...

Thank you very much for your input!

Mike

Here's one idea (see attached) ...

You would of course remove the status area and Users must use your buttons. They would hit Enter Find again and they can watch their OR criteria. If they wish to remove one of the criteria, hit the X. Then when ready, Perform Find.

Do not use the status area for this process; you should hide it using Hide Status Area [ Lock ]. You can also add a button to duplicate the request (next to the delete button). Sorry I didn't have time to get fancier.

UPDATE: I corrected the simple script and added Set Error Capture [ On ] so it would error trap.

FindRequests.zip

Edited by Guest

I didn't even begin my script with Get ( LastError) and of course I should have. :blush2:

It is quite fitting that this bit me seeing that I had an attitude on the subject just yesterday. Things that go around, come around ... or something like that. Anyway, please remember to error trap if this script is used.

  • Author

Hey LaRetta!

Thank you again for your help. I've tried it right away and it looks very interesting!

(Hope my users won't nag too much : It is just that as professional database users they are used to easy Boolean connectors like AND, OR, NOT, ( ), ATLEAST,...)

And Thanks for mentioning the error script thing, too! Very hepful!

Mike

Hi Mike,

The approach provided is just one way. I like it because, when there are many fields on the layout, it can also offer great flexibility by allowing the User to see their criteria and modify after the fact (and before they perform the find). But there are many approaches! If you can walk me through the vision of exactly what you would like, I have no doubt we can give it to your Users. Can you give me step-by-step walkthrough?

LaRetta :wink2:

If you want Users to type into one field (for example):

Douglas or Martha

Script can actually handle this. Let me know. But it can break easily with mistypes. BTW, this IS a professional database. But it will only be as good as the design. So give me your vision and someone here will help you make it so. :laugh2:

BTW, I corrected the prior file. I had Get ( LastError ) on my mind for reasons I won't go into. But what I meant is that you must trap for errors. I've modified the script slightly to account for no records found

Edited by Guest
Added BTW

  • Author

Hey LaRetta,

Many thanks for your efforts!! Wow. I tried the corrected file, thank you : Works fine!

As for the OR SEARCH: Exactly, a thing like Douglas or Martha is what I have in mind.

As mentionend, I am very reluctant when it comes to giving my users access to the menu bar. My aim is to place scripted buttons on the layout, so that "accidents" won’t happen all too easily. I created a Search Layout; so, when a user aims to find records, he clicks a button and a script starts that causes search layout to appear, the user then is being put in Find Mode, and while the script is stopped until he clicks Perform Find he can enter search terms. Most of the scripts include custom error messages, the change of global fields and so on. (I really like scripting : ) What I’d like to implement now is an easy OR SEARCH; I wonder if it is possible to create a script where a user enters Douglas or Martha in a field, and when he clicks the Perform Find button he gets all the records with either Martha or Douglas or both. As I haven’t found an easy way to create such a thing, neither in different forums nor in Filemaker books, I guess this won’t be easy...

And as for Filemaker being a professional database system: Yes, I am definitely of your opinion. It is amazing what Filemaker can do; and how well it helps the developer focusing on what is important. Just love it!

Here's something that could get you started (needs a lot more work, I think).

Search_AND_OR.fp7.zip

  • Author

Hey comment,

(Sorry for the late response - was away over the w/e), Thank you very much for your input and the file. Looks very interesting! This gives me a good start to work on the topic...

Regards!

Mike

:

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

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.