I'm not 100% clear on what you're trying to do. On the one hand, it looks like you're doing a cascading value list (choice in A narrows the available choices in B, which narrows the available choices in C). But on the other hand, it sounds more like you're trying to implement a Quick Search sort of feature where you have multiple search criteria that can insert into multiple fields. Those are two different things.
Can you clarify a bit?
If you can train yourself/your users to use the native FileMaker features, it's already available.
Control-click/right-click in the target field and choose "Constrain".
You can also make a simple script to do the same thing.
constrain.png 50.6 K
I believe that I am looking for a cascading list. I have setup a button (invisible - which triggers a script to set a variable and then perform a find in the clicked field based on the variable) over each field and am viewing the layout as a list. The idea is that the user can click on the value that they would like to filter by in Field1 refining the list, then Field2 further refining, and finally then Field3 refining further... or in any order they wish (3,2,1 etc).
The issue I have is making it so the fields can be clicked in any order.
1 of 1 people found this helpful
I think that Bruce's idea is probably the way you want to go, but with the scripted version.
Your buttons on each column would pass a parameter to the script, defining what column was clicked. Your script would want then run through a big IF statement that checked the value of the parameter passed in. When it finds a match, it already knows what column it is, so reads the value from that field and sets the FIND criteria in that field to that value. Since you are always only doing one at a time, that's all you need, really. Then you do a CONSTRAIN. Might look something like this:
// Read the current value (before you enter find mode)
if (parameter = "column1") set $value = tableA::column1
else if (parameter = "column2") set $value = tableA::column2
else if (parameter = "column3") set $value = tableA::column3
else if (parameter = "column4") set $value = tableA::column4
enter find mode
set error capture [on]
if (parameter = "column1") set field1 = $value
else if (parameter = "column2") set field2 = $value
else if (parameter = "column3") set field3 = $value
else if (parameter = "column4") set field4 = $value
Constrain found set
You could also pass in two parameters to the script: the field clicked on, and the current value in the field. That would simplify the script some what (would only have to do one logic check sequence), but make your button definitions more tricky.
1 of 1 people found this helpful
If I'm reading your request correctly it looks to me like you could use one script to do what you want.
I'd set it so each field was a button that did the following:
Button Click passes two parameters: Field Name and the value of the field clicked ( Field ; Text ).
Script would be something like this;
$fieldName = Value in your Field parameter
$text = Value in the Text parameter
$foundCount = Get(FoundCount)
$recordCount = Get(TotalRecordCount)
Enter Find Mode
IF $fieldName = "Field A"
Set Field ( Field A ; $text )
Else IF $fieldName = "Field B"
Set Field ( Field B ; $text )
Else IF $fieldName = "Field C"
Set Field ( Field C ; $text )
IF $foundCount = $recordCount
You could do this several different ways with calculated field names or whether you set varialbes with the parameter data or whatever, but this was the easiest way to type it out for this mesage :-)
Hope that helps,
Bruce - Thanks so much for the sample file. It was really helpful, taught me a lot, and enabled me to produce exactly the functionality I was looking for. The BIG thing that i didn't realize existed was the script parameter and I don't think that I was utilizing constrain found set correctly.