7 Replies Latest reply on Mar 31, 2012 9:21 AM by mrcrister

    Using "Yes" Checkbox to hide records from a layout through a table

      I'd like to use a checkbox to hide certain records from various table instances.

       

      Example

      A person record has Leader checkbox. Simply a Text field with checkbox data field on the layout using a Value List containing only Yes. When the checkbox is checked, the record appears in the special table, otherwise it is hidden. Sort of a query built into the relationships table.

       

      What I have tried to do is make a table instance and say that the Checkbox field must equal Yes (a global field I've created in a settings table) but it isn't working quite right. I've got more than one checkbox counting on this. Any ideas?

        • 1. Re: Using "Yes" Checkbox to hide records from a layout through a table
          Vaughan

          Look at FileMaker's record level access security, the ability for a user to view a record can be contolled by a calculation.

          • 2. Re: Using "Yes" Checkbox to hide records from a layout through a table
            RayCologon

            mrcrister wrote:

            Yes. When the checkbox is checked, the record appears in the special table, otherwise it is hidden. Sort of a query built into the relationships table.

             

            Hi mrcrister,

             

            You're talking about a filtered relationship that returns all records or a sub-set of records (or, perhaps, no records) depending on the status of a checkbox field.

             

            Certainly that's possible, and can be set up to work by adding the global filter field (the field you have called "Yes") to the table that your layout is based on, and including a pair of match fields connecting the global Yes field to the checkbox field in the related table as part of the relationship definition.

             

            While that's somewhat similar to the way you've described your setup, it's not clear from your post what the precise setup you're using is, nor what is occurring to lead you to say it's not "working quite right" (eg whether no records are returned irrespective of the value in the Yes field, whether all records are being returned, or some other variant of not quite right).

             

            If you can provide a little more detail about how you've set it up, and what exactly it is or isn't doing, it will be a lot easier for one of us here to spot the problem.

             

            Regards,

            Ray

            ------------------------------------------------

            R J Cologon, Ph.D.

            FileMaker Certified Developer

            Author, FileMaker Pro 10 Bible

            NightWing Enterprises, Melbourne, Australia

            http://www.nightwingenterprises.com

            ------------------------------------------------

            • 3. Re: Using "Yes" Checkbox to hide records from a layout through a table

              Sorry about the vaugeness.  What I mean is that the relationship is completely ignored, in otherwords all the records show up.

               

              So I should try adding a global "Yes" field to the table itself, create a second occurence that links the checkbox field with that variable and go from there?

              • 4. Re: Using "Yes" Checkbox to hide records from a layout through a table

                Well I've got it to work for once instance but another not so much.

                 

                In the first that worked, I created the "Yes" global field as directed and made it auto enter a calculation "Yes" and prohibit editing...no where to edit it anyways.  Great! The value lists based on that table occurance only show the records I want.

                 

                Different table altogether.  Now I'm trying to hide specific records from a printed report.  So I've created a hide checkbox that the user can check.  The same "Yes" global field (copied from the other table).  I've even gone as far to create a calculation field that gives the opposite value of Hide, so if Hide is Yes, Show is No.  The relationship between the "Yes" global field and the Show field asks for equivelancy. Maybe I'm making up terminology but the relationship is Yes = Show (so records that are to be showed should be included).  I don't quite understand this part so I may be missing something vital.

                Ray Cologon wrote:

                 

                "including a pair of match fields connecting the global Yes field to the checkbox field"

                 

                Thanks for the help!

                • 5. Re: Using "Yes" Checkbox to hide records from a layout through a table
                  RayCologon

                  mrcrister wrote:

                  ...I've even gone as far to create a calculation field that gives the opposite value of Hide, so if Hide is Yes, Show is No.  The relationship between the "Yes" global field and the Show field asks for equivelancy. Maybe I'm making up terminology but the relationship is Yes = Show (so records that are to be showed should be included).

                   

                  Terminology aside, what you've described is a viable filtering method, but is somewhat over-complicated insofar as you don't need two fields in the targetted table to achieve it.

                   

                  A single field that has an auto-enter to populate it with "Yes", a checkbox to hide records that sets them to "No" and an auto-enter calc to manage edits to the field (eg so that if the "No" checkbox is turned off, the value reverts to Yes) should suffice. With that in place, an equi-join ("=") relationship from a global field with the value "Yes" in the local table (ie the table on which the layout from which you want to view/access the filtered record set is based) to the auto-enter field will return only the records that have not been hidden (ie don't have "No" in the field the relationship points to).

                   

                  Regards,

                  Ray

                  ------------------------------------------------

                  R J Cologon, Ph.D.

                  FileMaker Certified Developer

                  Author, FileMaker Pro 10 Bible

                  NightWing Enterprises, Melbourne, Australia

                  http://www.nightwingenterprises.com

                  ------------------------------------------------

                  • 6. Re: Using "Yes" Checkbox to hide records from a layout through a table
                    comment

                    mrcrister wrote:

                     

                    Different table altogether.  Now I'm trying to hide specific records from a printed report. 

                     

                    Make sure you understand the distinction between related set (as shown in a portal, for example) and found set (the records viewed  through a layout based on the same table). In Filemaker, a layout cannot be really set to filter the records shown. The closest you can get is attach a script trigger to the layout to perform a find when the layout is entered. But inherently, all layouts are capable of showing all records of the underlying table.

                    • 7. Re: Using "Yes" Checkbox to hide records from a layout through a table

                      Ah ok, that is the downfall. I'll just set up a found set dealio. I was using that before but it wasn't ideal. I'll make it work. Thanks!