Jump to content
Sign in to follow this  
OASES

How do I do Omit finds In Global Field Transfer Finds?

Recommended Posts

I'm using global fields in browse mode to enter my find criteria, but how do I allow the user to select Omit criteria?

Share this post


Link to post
Share on other sites

I'm assuming that you are using a script to go into find mode and then copy the global values into the appropriate fields.

Create an additional global field set up as a check box to allow the user to select 'omit' or not. When you execute the search, test the value of the omit global. If it is checked then execute an Omit Record/Request step in the script before you do the perform find step. If you want to select or omit multiple combinations of criteria, you will need an additional global omit field for each global search field. Then you will have to set up multiple search and omit requests in your search script. Exactly how you set this up will depend on how sophisticated you want the user's search options to be.

Share this post


Link to post
Share on other sites

Thanks for the response Bob. But does this mean that I can't use the "simple" find functions built into FMP already, such as multiple find requests, without having to create additional global variables such as FirstNameSearch1, FirstNameSearch2, etc.? So then basically the user's search options will be limited to how many I predetermine in the global fields?

Share this post


Link to post
Share on other sites

Consider the following:

Scenario 1

Search for all records whose First Name = "Bob" and omit records whose Last Name = "Weaver"

Scenario 2

Search for all records whose Last Name = "Weaver" and omit records whose First Name = "Bob"

Do you want to allow the user these kinds of searches? Both have the same field values, and include one find criterion and one omit criterion. Yet, they should produce different results. You have to decide just how complex you want the searches to be. The amount of information you need to get from the user will increase with the complexity.

Can you describe in more detail what sort of searches you want the user to do?

Share this post


Link to post
Share on other sites

Ok, here's what I tried to do. I'm creating a database of students in our tutoring organization. It's a relational database with Tutee and TuteeProgramHistory (TPH), where Tutee has a portal to TPH to show multiple entries. However, regular searching will produce awkward results (searching for Fall 2001 students will yield me students from our Fall 2000 and Spring 2001 programs, since the search looks for any instance in any row of the portal). I tried to solve this problem by using global fields to create a hashed field (if the user wanted to find students for a particular semester and year, then through a calculation I would combine their query to a field called SemesterAndYear, instead of having two separate variables and thus allowing it to look for a combination in the rows. However, then I realized I can't really use the built in functions for searching. A definite goal of the database is to allow the user to search for all students enrolled in our Spring 2001 General Tutorial program but omit everyone from any Fall 2000 programs. The tutee database will be mainly used to autogenerate letters, create roster sheets, and create mailing labels and name tags. And all this relies on the ability to sort out those that are not in a specific tutorial program or a specific semester. Hope this clarifies to you what I'm trying to accomplish.

Share this post


Link to post
Share on other sites

Doing finds in related records, as you have discovered, can lead to bizarre results.

You should set up a calculated field in the related file like so:

YearSemester = Year & Semester

Then, put that field on the layout in your main file. Use it for searching. It should produce the results you want.

Share this post


Link to post
Share on other sites

I was trying to avoid doing something that would make the find page so messy, but I guess I can't avoid it. Thanks Bob for all your help.

Share this post


Link to post
Share on other sites

There are a number of ways to keep the layout looking clean. Try using separate year and semester global fields, and don't display the related yearsemester calculated field. You can make a "Find" button script that does this:

Go to Find mode [no restore]

Set Field [TPH::yearsemester = year & semester]

Perform Find [no restore]

[ March 29, 2001: Message edited by: BobWeaver ]

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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