Filemaker Pro Lesson
Relational Concepts - Internal Tables vs. External Files:
Defining A Relationship
This lesson requires Students.fp7 and Schools.fp7.
Open the Students.fp7 and Schools.fp7 file. These files were converted from Filemaker Pro 5.5 files.
In previous versions of Filemaker Pro, these files would be related as two separate files. Now Filemaker 7 provides the opportunity to create separate tables within a single file. Letting multiple tables share the resources of a single file dramatically cuts down on the overhead in your file.
For example, scripts are now shared among all tables. Using the old method, if we related the separate files Student and Schools then wanted to produce a list of students attending a particular school using a menu layout in the Schools file, we would first have to write a script in the Student file to subsummarize all student records for each school. Then we would have to write a script in the Schools file that called that external script in the Students file to attach to the menu button in the layout in the Schools file. Instead with Filemaker Pro 7 we open the Student.fp7 file and create another table within the same file.
Creating a Relationship in Filemaker Pro 7 and importing data from a converted Filemaker Pro 6 file.
1. Open the file Student.fp7. Select File ->Define -> Database and select the Tables tab. Enter Schools for the table name and click Create. Now select the Fields Tab. If not already selected, select the Schools table. Create a number field named School # and text fields named School Name, Dept Coordinator, Dept Phone, City and State.
2. Now click on the Relationships tab. Click on the Schools table field School #. Holding the mouse button down, drag the field on top of the School Number field in the Students table and click OK.
Now click on the little box containing two lines in the center of the relationship connecting line. You will see that the fields are now specified as equal to each other in the Edit Relationship dialogue box. Notice the Add button. New with Filemaker Pro 7 is the ability to specifiy more than one match field. For example, here at the University we identify a course by a unique CRN number. However, CRN numbers are reused in subsequent terms. Therefore, if you have a table of course information that includes information from multiple terms you cannot use a CRN as a unique record identifier. However, now you can establish a relationship by the fields CRN and Term. You will also notice that the relationship operator is a dropdown list. The default is "=". However, with Filemaker Pro 7 you can also choose other operators. For example, if you create a field called Target Term in a student table then create a relationship between the Student IDs and the field Target Term in the student table and term in the course table and specify the operator ">", you can create a portal that views all courses the student has taken after a particular term by basing it on that relationship.
3. To populate this internal table with the data in the old file, we must import it. IMPORTANT: Select a layout with fields on it from the table Schools. This will set the import target table to Schools. Select File->Import Records->File and select the file Schools.fp7 and click Open. Make sure field names are arranged opposite each other (you may click and drag fields in the right hand column up or down if they are not) then click Import.
Similarly, value lists are available in every context, rather than having to replicate copies in each file that requires it. Although we could refer to a value list in another file in Filemaker Pro 5.5 or 6, we still had to define the value list in the external file and indicate that the values were to come from a value list in another file we specified.
4. Using our Students.fp7 file select File->Define Value Lists. Click on New and enter School Names for the value list name and click the radio button for Use Values From Field. Select Schools from the Tables drop down list and click on the field School Name and click OK. Because the file Students.fp7 now contains the tables Students and Schools, the value list can be used on any layout referring to fields from either table.
There's also no need to duplicate security settings in each of the many files of a large solution. A FileMaker Pro 7 file lets you set those privileges once, and they apply across an entire large, complex solution with numerous tables.
5. Select Edit->Sharing->Network Settings. Select the file Students.fp7 from the list of open files and click the Network Sharing On radio button if it is not already set. Notice that you can set sharing privileges to all users or you can specify users by privilege set. Filemaker 7 has predefined three default privilege sets. The admin privilege set can, of course, perform any operation including defining new fields, designing new layouts, etc. The data entry privilege set can enter data but all database structure modification and design functions are disabled. The read only privilege set can only look at data but they cannot make any data changes or access any other functions. Accounts are defined by username then privileges and passwords are set.
6. Select File->Define->Accounts and Privileges. Click on the Admin account and click the Edit button. Notice that you can assign a password then select the privilege set to define the activities of this user. Click on the Edit button next to the privilege set drop down list. Privilege sets can also be edited to restrict access to particular records, particular fields, particular drop down lists, and particular scripts. In addition, you can allow a user to override field validation requirements on a user by user basis.
If you have an RSS feed that
would be of interest
to faculty and students at the College of Education
please contact Mary Harrsch.
Last updated: 12/28/2004