8 Replies Latest reply on May 30, 2017 3:30 PM by cliffribeiro

    List view does not filter

    cliffribeiro

      Hey guys, I have a fairly complex database and pretty familiar with filemaker. So here I go

       

      I made a fairly complex query in my relationships graph and would like to display the contents in list view. For whatever reason the list view displays all the records not the filtered query. When I go to a layout, and display those relationships by means of a portal, they display accurately displaying only what should be displayed. In list view everything all records show up versus just the filtered results. Is this how list function works? do I have to do a search to filter items? Thoughts comments?

        • 1. Re: List view does not filter
          CarlSchwarz

          A list view does not go through a relationship, you are looking at the base table of the layout you are on when you are in the list view.  It is not like a portal where you are looking through the relationship.

          To filter a list view you need to reduce the found set, i.e. perform a find.

          • 2. Re: List view does not filter
            Stephen Huston

            List view shows the "Found Set" of record, so, Yes, you need to control it with a search. Or you could arrive there via a GTRR (go to related records) script step. If using GTRR, you have to set the script step options to show only related records if you don't want everything.

            • 3. Re: List view does not filter
              cliffribeiro

              This becomes increasingly difficult with complex queries.....darn it.....Using the relationships would make so much sense....

              • 4. Re: List view does not filter
                cliffribeiro

                So with this search that I need I would have to create a list of keys that are related by means of a relationship and script so that it searches for those keys. Quite a few extra steps and tweaking wishing it was the other way around. Why isn't it?

                • 5. Re: List view does not filter
                  erolst

                  You are expecting that with a relationship of

                   

                  TableOccurrence1 -- TableOccurrence2

                   

                  simply entering a layout based on TableOccurrence2 would perform a Find / act as a filter equivalent to the predicates of the relationship definition.

                   

                  cliffribeiro wrote:

                  wishing it was the other way around. Why isn't it?

                  That cannot work for several reasons:

                   

                  1) Being on a record of TableOccurrence1 gives you a context to resolves the predicates in the relationship and find a matching set. If you are in a layout of TableOccurrence2, what record from TableOccurrence1 should constitute that context?

                   

                  2) Imagine

                   

                  TableOccurrence1 -- TableOccurrence2 -- TableOccurrence3

                   

                  Now which of these two relationships should act as the filter for a layout based on TableOccurrence2?

                   

                  If you want to use the "query" encoded in the relationship predicates, go to a record of TO1 and use Go to Related Record with target TO2 and 'matching only'; or construct a Found Set in TO1 and use GtRR with the additional option 'match all in found set'.

                  • 6. Re: List view does not filter
                    CarlSchwarz

                    cliffribeiro wrote:

                     

                    So with this search that I need I would have to create a list of keys that are related by means of a relationship and script so that it searches for those keys.

                    You already have the keys since you already have a working portal.  Just grab those values that are making the relationship work and do a find with those values mimicking your relationship.  Your script would look like

                    Enter find mode

                    set field...

                    perform find

                     

                    Or as StephenHuston pointed out before go to your source record and use "Go to related record" do go to the subset of records.

                    • 7. Re: List view does not filter
                      taylorsharpe

                      I think Stephen Huston's suggestion is the best for what you want (GTRR) even though I hate that function because you can't look at it in a script and see what it does without opening it (which is why I just manually do the script steps to go to a new layout and perform the find).

                       

                      I probably would approach this different by using a virtual list and SQL.  Just my preference because there are lots of ways to achieve the same results in FM.

                      • 8. Re: List view does not filter
                        cliffribeiro

                        I ended up using the GTRR script. It worked out well. Thanks everyone.