1 Reply Latest reply on Jul 18, 2014 11:14 AM by philmodjunk

    Using Two Global Search Fields to filter portal records

    JasonAhn

      Title

      Using Two Global Search Fields to filter portal records

      Post

           So here is my situation.

           I have a data table (price) that has fields, Material and Description

           I made a global table with global.material and global description

           I have a layout which displays the global fields at the top intended to search from and a portal below to show related fields from table Price

           I've managed to use setup a filter on the portal so that the global material and global description can be partially filled in and the portal will populate with matching records using a combination of the IsEmpty and PatternCount functions.

           Here is the issue. If I enter a value into the global material field, it will search correctly. If I enter a value in the description, it will not bring back any values. If I enter a value into BOTH the material and the description, it will work correctly and use both fields to search for records.

           I'd like to be able to search just the description as well and have it bring back all records, without having to put a value into the material field. I suspect it may have something to do with the table relationships I have set up. Does anyone have an idea on how to get this to work?

        • 1. Re: Using Two Global Search Fields to filter portal records
          philmodjunk

               Use Or in your portal filter so that you can filter when one field is empty and the other not:

               ( IsEmpty ( Global::Material ) And PatternCount ( Portal::Description ; Global::Description ) ) or

               ( PatternCount ( Portal::Description ; global::Description ) And Patterncount ( Portal::Material ; global::material ) ) or

               (IsEmpty ( Global::Description ) and Patterncount ( Portal::Material ; Global::Material ) )

               You might be interested in the search portal examples found here: https://www.dropbox.com/s/0pm1gdqcfi2ndpv/EnhancedValueSelection.fp7

               They update keystroke by keystroke and do not use RefreshWindow to get the portal to update as the data used in the filter changes.

               (FileMaker 12 and newer users can use Open from FileMaker's File menu to produce a copy of this file converted to the newer file format.)