polarpro Posted July 30, 2008 Posted July 30, 2008 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
LaRetta Posted July 30, 2008 Posted July 30, 2008 (edited) 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 August 1, 2008 by Guest
LaRetta Posted July 31, 2008 Posted July 31, 2008 I didn't even begin my script with Get ( LastError) and of course I should have. 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.
polarpro Posted July 31, 2008 Author Posted July 31, 2008 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
LaRetta Posted July 31, 2008 Posted July 31, 2008 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:
LaRetta Posted July 31, 2008 Posted July 31, 2008 (edited) 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. 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 August 1, 2008 by Guest Added BTW
polarpro Posted August 1, 2008 Author Posted August 1, 2008 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!
comment Posted August 1, 2008 Posted August 1, 2008 Here's something that could get you started (needs a lot more work, I think). Search_AND_OR.fp7.zip
polarpro Posted August 5, 2008 Author Posted August 5, 2008 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 :
Recommended Posts
This topic is 5953 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now