5 Replies Latest reply on May 4, 2013 5:54 AM by brianquillin

    Using a Drop Down Menu to Filter a Portal

    TurtleKoala

      Title

      Using a Drop Down Menu to Filter a Portal

      Post

      Sorry if this is a silly question, but I just started using FileMaker Pro yesterday so I'm still figuring things out. I was wondering if it is possible to filter a portal based on the value selected in a drop down menu. Essentially, I have a drop down menu that allows you to choose a category, and I only want records that have the selected category to show up. Also, on a related note, is it possible to store the selected value chosen in a drop down menu as a global variable?

       

      Thanks for any help 

        • 1. Re: Using a Drop Down Menu to Filter a Portal
          aammondd

          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)

           

           

           

          • 2. Re: Using a Drop Down Menu to Filter a Portal
            philmodjunk

            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.

            • 3. Re: Using a Drop Down Menu to Filter a Portal
              aammondd

              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.

               

              • 4. Re: Using a Drop Down Menu to Filter a Portal
                TurtleKoala

                Thanks for the help.

                • 5. Re: Using a Drop Down Menu to Filter a Portal
                  brianquillin

                       I realize this is an old thread but this was helpful.  Hopefully someone can explain or address my problems when applying Phil's technique.

                       PROBLEM:

                       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.

                       PROBLEM 2:

                       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)