2 Replies Latest reply on Oct 24, 2011 11:54 AM by mgores

    Show certain records in a layout based on one field

    art_edu

      Title

      Show certain records in a layout based on one field

      Post

      Hello,

      I have what I thought was a simple task - I'd like to create a layout for "student rosters" for each class at our school. The layout should pull all the student records for students who are in a specific class. I created a script that finds the students based on the information in the "class" field, but I can't figure out how to make the layout use that script to show only those students. The layout shows all students, regardless of which class they're in. I'm a newbie to FileMaker and have been disappointed with how incredibly complicated every simple little thing is. Can anyone give some advice on how to simply select records based on the info in one field and then make those records display in a layout?

      Thanks!!

        • 1. Re: Show certain records in a layout based on one field
          philmodjunk

          What you described: "I created a script that finds the students based on the information in the "class" field, " sounds like exactly what you should do and it should work. Since it didn't, you'll need to describe this script and your layout in greater detail so we can determine why it didn't work.

          Generally speaking, if your layout is based on the table on which you are performing the find, then performing the find should pull up the students you need to print out as your "roster".

          The structure of your database could be the issue here as what you describe typically requires a many to many relationship as a given class can list multiple students and students take multiple classes (unless this is elementary school or a similar set up with one class to each student.)

          • 2. Re: Show certain records in a layout based on one field
            mgores

            It sounds like you have the script, but need a way to make the script run when you go to the layout.  I assume you are looking at a layout where you have the class info, then change to the student list layout to see the students that are in that class.  You could incorporate your script into a button that takes you to the student layout by setting a variable to hold the class info, go to the student layout, then perform your find using the variable for the class info find critera.

            If you do have the many to many relationship as Phil described, you could set up another layout for the class with a portal to students listing all students in that class.  This would avoid having to perform a find or have a script.