(I would love to do that in a portal on the main window but that will not work)
With Portal Filtering in FileMaker 11, it might if you can craft a calculation for your portal filter that serves to replicate what you are doing when you perform the find. It's possible, for example to set up a portal of records that changes keystroke by keystroke when you type text into a search field positioned just above the portal. This can be a "contains" or "starts with" type of pattern matching, just to give two possible examples.
There are other get functions that will get you the height of the window as well as it's "top". You can also "lock" that status area in a script step if you don't want to permit the users to change this setting.
Actually I do have a portal that works well (you helped me design it a while back) when I have limited calculations to do to narrow down a search but it relies on a pull down list from existing inputs. So I have two questions:
How can I get the "contains" or "starts with" find to work in the portal? Now for example, I am using a pulldown menu and the portal filter looks like this:
If(Global::Denomination = "";IsEmpty(Global::Denomination); MainWindowDetail::DenominationName = Global::Denomination)
This only works for an absolute input (not "contains" or "starts with".
Second, what is the script step to lock the status area?
Show/Hide status area has a "lock" option that can lock the status area.
Take a look at the two portals at the bottom of the layout in this demo file. The left is set up with a "starts with" pattern match. The right uses a "contains" pattern match. You'll find the left hand portal uses a Left function to compare a matching number of characters of a field in the portal table to the text in the search field. The right hand portal uses a PatternCount function to filter for records where the field in the portal table contains the text entered in the search field.
Very nice shared file. Execution much better than what I scripted and the pattern matching and starts with search are awesome. Now I have some reprogramming to do.... One question left - what is the script step to lock the status area so users cannot change it?
Show/Hide status area [//select Hide or Show here ; Lock ]
PhilMod: everything works well except in my gSearch field on my layout, when I start typing the text I want to search (using Pattern match), it types it in backwards! For example, if I want to type the word "English", I get "hsilgnE" in that field. What's up?
Nevermind! I figured it out - when I copied your script and changed the field name, it also created some * and / characters before and after my field and that is what created the wackiness.
Is there a Get function for finding the number of records in a portal (I have search my table and am showing only specific records that meet a search critieria by filtering the portal)
No, but there are ways to do it.
Define a summary field in the portal's table with the "count of" option and set it to count a field in your table that is never blank.
Place this summary field inside your filtered portal and it will display the count of how many records currently meet the portal filter criteria.
You can duplicate your existing portal so that it has the same filter expression, but change it to be a single row portal, make the borders invisible and then you can place portal and summary field on your layout next to the original table to display the record count in your portal.