You can use a field set to global storage and build a relationship between this field and a field in the portal table.
I use this method all the time. you can use radio buttons, drop downs, etc to set that Global field.
I often put these global fields in their own table (if you do this then you have to have a relationship between the Global table and your layout table (can be cartesian) and you must have at least 1 record in the global table to show portal data)
With FileMaker 11 you no longer need to include the global field in the relationship though this is still a very valid option to consider.
Say you have this relationship:
LayoutTableOccurrence::anyfield X PortalTableOccurrence::anyfield
and you define, gSearchText as your global field.
Then you can use any number of different filter expressions such as:
YourTable::gSearchText = Left ( PortalTable::Name ; Length ( gSearchText ) )
PatternCount ( PortalTable::Name ; YourTable::gSearchText )
The one extra requirement with such a portal filter is that you have to force the portal to update each time you change the value in the global field.
Refresh Window [Flush cached join results]
Is a one line script to do that, you can use OnObjectSave on your global field to force the update each time you edit the data in the field. You can also use a more sophsticated script with OnObjectModify to update the script keystroke by keystroke.
no scripting needed doing it the other way :)
It is good to know about the filter option though because it can come in very handy.
I just think it simpler to do it my way as you have to add the filtering field and set it anyway.
Though you can get really fancy and use a combination the two
ie set a global field via radio button to a status code
then use Phils search text ideas to filter the portal even further.
Thanks for the help.
I realize this is an old thread but this was helpful. Hopefully someone can explain or address my problems when applying Phil's technique.
I've set the script trigger 'OnObjectModify' to Refresh Window BUT the window does not refresh until I've exited the search field. If I add Commit Records, I cannot continue typing in the field.
The script debugger shows that it is refreshing the window but the portal records do not update until after I exit the search field then manually refresh the window.
I want my portal to show ALL records at first, then remove records as they are filtered out (when the filters are applied). I need some filtering guidance on this also.
Thanks in advance...
(Filemaker Pro Advanced 12.0v4)