Jump to content

consolidating Find scripts

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

Recommended Posts

My database has layouts that contain what I refer to as Quick Find buttons. Each button performs a simple find operation based on a specific field having a specific value.

For example: The "New Orders" Quick Find button finds all of the order records that have the value of "New" in the Order Status field.

I have about 5 to 10 such buttons on each layout in my database totaling about 40 Quick Find buttons.

The problem is that there is a script associated with each button therefore I have to maintain this huge list of 40 find scripts. What I'd LIKE to able to do is have just ONE find script for each layout that conditionaly performs the appropriate find operation based upon which Quick Find button was clicked, but I'm miffed about how to accomplish this in Filemaker. Anybody have any ideas?

Link to comment
Share on other sites

You'll have to use the Clairvoyance[] function. wink.gif There is no way to use only one script. You can use one long script and one short script per button. If you have the same script assigned to every button, there is no way to tell which button called the script (except to use the Clairvoyance[] function).

For the short and long scripts, the short script sets a global to 1 for the first button, 2 for the second, 3 for the third, etc. The long script tests the global and sets up the correct find.


Link to comment
Share on other sites

To take it a step further. You can utilize the Status(CurrentScriptName) to set a global field this way only need to create a script once then just duplicate it and rename the script. With some position functions and some left and rights you can determine the scritps number..

Script Name: BTN: Quick Find 5

In the script you can get the right most word then utilize that in the long script step. At least creating the individual scripts will be easy. Because you just duplicate and rename.

Link to comment
Share on other sites

This topic is 7856 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.