4 Replies Latest reply on Feb 27, 2015 11:15 AM by phcaputo@gmail.com

    Subsets of Tables?



      Subsets of Tables?


      Hi- I come from an object oriented programming background but haven't been programming in 10 years. I got FM about 1 year ago and created simple databases and relationships, which has worked well but I want to increase functionality. I am not sure what the correct terminology is to use, so I will do my best!

      My question is how do I create a table that is a subset of an existing table. For example, I have Table A that has 10 fields in it. I want to define a table that has the same entries, but 3 of the fields aren't used.

      I guess another way to look at this is a parent-child relationship. The parent has 7 fields, a child has the same 7 plus 3 more.

      What is the best practice in FM?  Could I use a match field to identify the table as a child of the parent, or a type of a table? Any insight would be appreciated!!! I find that I get confused between FM and actual code writing, if that makes sense...








        • 1. Re: Subsets of Tables?

          Why do you need that additional table? In fileMaker, you, as the developer can manually create additional tables. You can use FileMaker Advanced to copy and paste a table definition. In both Regular and Advanced versions, you can use Import Records with the New Table option to create a copy of an existing table and it's current found set of data.

          But FileMaker is not set up to dynamically create/delete tables  in response to the general user interacting with the database and that isn't something often needed anyway.

          Usually, "subsets of a table" are treated as different groups of records all in the same table. Unlike the "recordset" of many other DB systems, FileMaker's "foundSets" are a lot more dynamic-with many user initiated ways (as well as those we as developer set up) to pull up different subsets of records to for review and editing or for a report.

          • 2. Re: Subsets of Tables?

            Thanks for responding! I really appreciate it!

            I think I understand what you are saying- just to be sure, it sounds like I can set a flag in a table to distinguish different types of tables? This way I can use portals to see the different types by changing a parameter and matching it to the flag?





            • 3. Re: Subsets of Tables?

              You can set values in fields to identify records as being members of different categories. And then there are a number of ways, a portal being just one option, that just the records from one category will appear in the portal.

              One trick that I've used is to set up the category field used as a Match field in the relationship and place it as a check box formatted field near the portal. Selecting different check boxes then changes which categories are visible and if you select several check boxes, you get all of the selected categories.

              But many other options are possible--including layouts that automatically limit you to records of a given category and settings in Manage | Security that hide records from the user (with a bit of added scripting) if they are not authorized to view them...

              • 4. Re: Subsets of Tables?

                Thank you so much! I really appreciate it!