Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7240 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi.

I would like to have a Find button on my solution that will prefrom a find, that will NOT look at the previous found set.

For example the first time a ran a find on all new records I typed in "first name" in that field & it found that record, however the next time I did a find it didnt give me an option to type in a frist name, it just fount the record from the 1ast time I used find. How can I make the find button clear all previous finds, then ask me "what to find"? (using that 1 button)

What I really need is to add the Continue Button (Continue (a button created by FileMaker Pro in the status area) to my Find Button. But I don't know how.

Thanks again.

Kicker

Posted

You need to make your Find button run a script. Also, you should make a global field for the user to enter find criteria. The script would Enter Find Mode (Restore OFF), then Set the field being searched on (first name, for example) to the contents of the global entry field. Then it Performs the find (restore OFF), and resets the global field to empty.

In general, any find operation always works on the whole database, not just the previous found set. I'm not sure what you have attached to your button, if it is a script similar to the above, you probably have the restore options clicked ON with the Enter Find Mode and/or Perform Find script steps. This will make your script ignore whatever you want it to find, and find whatever it was that someone most recently ran a find on.

Steve Brown

Posted

Kicker:

Before your Enter Find Mode step, add:

Show All Records

This will ensure that your find will search the whole database.

-Stanley

Posted

Thanks

I did that, I guess what I need it to put the Continue Button on the layout itself & not on the status area. If that is possable, so I can hide the status area & people can still do a find.

Posted

Kicker:

That is a good idea. I try to keep the status area hidden from the user as much as possible. Your button would be defined to "Resume Script" and that's it. You can also put up some text on your find layout that says "type in your search criteria, then hit 'enter' to continue", because that works, too.

-Stanley

Posted

Unless you're using Contstrain or Extend Found Set, it shouldn't matter if you Show All Records before performing a find, because a find operates independently of the found set. It sounds like something else is going on here.

Posted

Stanley

would that be my find button that I created?

also exactly what the script look like?

Right now it looks like:

My script reads:

Show all Records

Enter Find Mode [Pause]

Prefrom Find []

Thanks for all the help

Posted

Kicker:

No. Your find button launches the script. Your new button just resumes the script. You'll want to create a duplicate of your layout, remove the "find" button, and put in a resume button. Your script would now look like:

Go To Layout [your new layout]

Show All Records

Enter Find Mode [pause]

Perform Find []

Go To Layout [original layout]

And while it's true that the find should search the entire db anyway, I've always put Show All Records before a find, just out of habit.

-Stanley

Posted

Back on the original issue, Queue is correct. You do not need a Show All Records step, because a find will always work on all records, regardless of what found set you have at the time you run the script.

You say this is your script:

Go To Layout [your new layout]

Show All Records

Enter Find Mode [pause]

Perform Find []

Go To Layout [original layout]

If this is your whole script, you haven't told the script what to find. Open the script again in Scriptmaker. Highlight the Enter Find Mode step. Is the little box at the bottom of the window labelled "restore" checked or unchecked? Do the same with the Perform Find script step.

If either or both have "restore" checked, your script is running a memorized find. If not, it doesn't know what to find.

I'd make a global text field, call it g_Search, and place it in the layout for the user to enter what they need to find. If they are searching for, say, a name, then your script becomes:

Go To Layout [your new layout]

Enter Find Mode [pause] ***Restore UNchecked***

Set Field(LastName, g_Search)

Perform Find ***Restore UNchecked***

Set Field(g_Search, "")

Go To Layout [original layout]

This will make the script try to find matching records between the info the user put in the global g_Search field and the LastName field (it also clears the g_Search field after the Perform Find).

The beauty of this is that if you learn that your data can have the name in the FirstName field, you just add steps to the script to search both fields:

Go To Layout [your new layout]

Enter Find Mode [pause] ***Restore UNchecked***

Set Field(LastName, g_Search)

New Record/Request

Set Field(FirstName, g_Search)

Perform Find ***Restore UNchecked***

Set Field(g_Search, "")

Go To Layout [original layout]

And so on. In scripting complex searches, I've found this is far easier to alter or debug than memorizing a find. I have a database with a global search field combined with a "go" button running one of these scripts that is simultaneously searching 23 fields, with 23 find requests. I can easily add or subtract a field or two from the script, but it would be a monumental hassle to carefully set up a manual find and memorize it.

Steve Brown

Posted

Hey Steve, I think the idea here is for user-defined find criteria, without the use of global fields. Hence the pause on Enter Find Mode.

Posted

Oh. Okay, though it sounds like he's is giving a dangerous amount of control to the user.

Couldn't you do away with the pause by breaking it into two scripts? The first script just Enters Find Mode and stops. Now the user is in Find, on the needed layout, and fills in the fields needed. You could make a "Go" button that runs a script that starts with Perform Find.

Can you click a button and run a script while in Find Mode? I've never tried to do that.

Steve Brown

Posted

Yes, you could break it into two. I often make the first one

Enter Find Mode [Pause]

Perform Script [Continue Find]

and use a button on the layout that merely Resumes the script. I think it's cleaner than completely divorcing the two, but depeding on one's purposes, it may be more useful to just Enter Find Mode and have a button to trigger a separate script.

This topic is 7240 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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