Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

Using a script parameter as a find/restore criteria


Recommended Posts

Posted

I've got script parameters in buttons that I would like to use to find records.  Any thoughts?

Posted (edited)

More details would be helpful. 

In general, you could do either:

Enter Find Mode []
Set Field [ SomeTable::SomeField ; Get ( ScriptParameter ) ]
Perform Find []

or:

Set Variable [ $criteria ; Get ( ScriptParameter ) ]
Perform Find [Restore]

where the $criteria variable is used as the stored criteria.

This is assuming the script parameter holds the find criteria as is. Of course, you can also use a calculation in the Set Field / Set Variable step to modify the parameter - as you could have seen here:
https://fmforums.com/topic/108535-escape-out-of-a-popover/#findComment-487794


P.S. You posted this in the FileMaker Pro 16 section and your profile says Version: 11 Client. Please update your profile so we know what you can use.

 

Edited by comment
Posted

Thank you for your reply but I can't seem to get any suggestions to work.

Let me explain this a bit better.  I have a button that creates several pop-over buttons, say Botton 1, Button 2, Button 3, ....Button 10.  Each pop-over button has a unique script parameter associated with each button, i.e, Button 1 script parameter is "Button 1", Button 2 script parameter is "Button 2", ........Button 10 script parameter is "Button 10".  I'm looking to find the numerical data related to the query provided by the passed script parameter.  For example, if I use this very short script:

Enter Find Mode []
Set Field [ test::BT ; Get(ScriptParameter) ]
Perform Find []
Go to Layout [ ... ]

 

I'm looking for FMP to find all occurrences >0.00

The result is that FMP replaces the data in the first field it finds with the content of the script parameter

It appears to me that FMP is looking for the TableName::FieldName to search through rather than passing the script parameter to the FieldName. 

All the data is stored in different records of the same field name that is represented by the script parameter.  Any other thoughts?

Posted

Sorry, I am not able to follow your explanation. A button does not "create several pop-over buttons".  And it makes no sense to make the script parameter "Button 1" unless you want the script to find records that contain the text "Button 1".

Let's concentrate on what you want to accomplish here: I understand you want to have several buttons and each button would call a script that finds some records. The first button should find records where the BT field's value is greater than 0. What should the other buttons find?

 

Posted

Maybe this pictorial will help some of you "get the picture" of what I'm trying to achieve here.

Please advise.

FMP ScreenShot.png

Posted (edited)

If your script is what you posted earlier, then clicking the button labeled "WATER" should find records where the BT field contains a word that starts with "Water" and a word that starts with "Bill". 

You probably need to go to the appropriate layout before setting the field and performing the find.

 

23 hours ago, revjj said:

The result is that FMP replaces the data in the first field it finds with the content of the script parameter

That is not what your script does - at least not the part you posted here.

 

Edited by comment

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.