6 Replies Latest reply on Mar 11, 2012 5:00 AM by comment

    Trouble creating a "filtered" layout.

    measteruncc

      I am sure this sounds like a silly question, but I am trying to create a Layout based on a "Contacts" table. I want the layout to show only those records that are marked "N" in a field named "Obsolete".

       

      In the world of MS Access, you would create a query, include the field named "Obsolete" in the query, and have the criteria for this field set to "No".

       

      I am wishing to now move over to filemaker, and can not fiqure out how to do this.

       

      Please help.

       

      Thanks,

      Mike

        • 1. Re: Trouble creating a "filtered" layout.
          gcatnine

          The first simple thing is to create a script in which you just find the records Obsolete = N.

          Using this script in the layout event “OnLayoutEnter” (trigger) any time you display this layout the search is performed.

          • 2. Re: Trouble creating a "filtered" layout.
            measteruncc

            Hi, thanks for the response.  If I handle it this way, and some clicks on "Show All Records" will it then show all records includeing those that are marked obsolete?  I would like that to be prevented.

            • 3. Re: Trouble creating a "filtered" layout.
              gcatnine

              "Show all records" is normal that show all records.

              This could be prevented usind security.

              when you define a privilege set, just rstrict Avalible Menu Commands to Editing Only and the command become hidden.

               

              but depending on you solution, there is another method, little more complex.

              it is to use a join table and GTRR (GoTo Related Record) command.

              In the contact table create a global calculated field (gObsolete) with value text N

              In manage Database > Relationships, duplicate the Contact table.

              Create a relationships between Contacts::gObsolete and Contacts 2::Obsolete (not vice versa)

              Define an empty layout that show records from Contact 2

              And create a script:

              Goto layout Contact 2

              GoTo related record from Contact, using layout …. Show only related record (Match current record only)

              • 4. Re: Trouble creating a "filtered" layout.
                gcatnine

                a third solution, always with the join relationship id to use a portal

                • 5. Re: Trouble creating a "filtered" layout.
                  Malcolm

                  I am sure this sounds like a silly question, but I am trying to create a Layout based on a "Contacts" table.  I want the layout to show only those records that are marked "N" in a field named "Obsolete".

                   

                   

                  In the world of MS Access, you would create a query, include the field named "Obsolete" in the query, and have the criteria for this field set to "No".

                   

                  It's not such a silly question. There isn't a direct equivalent to this in FMP. You have several options to achieve the same result.

                   

                  1. Create a table especially for the purpose. This involves some setup with tables and relationships and layouts. It will do exactly what you want.

                   

                  2. Use a "virtual" table technique and supporting scripts to manage the task on the fly

                   

                  3. Use scripts to control the found set.

                   

                  malcolm

                  • 6. Re: Trouble creating a "filtered" layout.
                    comment

                    measteruncc wrote:

                     

                    In the world of MS Access, you would create a query, include the field named "Obsolete" in the query, and have the criteria for this field set to "No".

                     

                    In the world of Filemaker, a "permanent query" is implemented by a relationship. Instead of a "filtered layout", you'd have a portal.

                     

                    There is no "filtered layout" as such - any layout can show any found set. Setting a layout to constrain the found set on load and removing users ability to show all records can provide a reasonable alternative.