Filemaker Pro Lesson
Relational Concepts - Internal Tables vs. External Files:
Using Portals to enter data in a many-to-many relationship
This lesson requires Students.fp7.
Using a portal in the student file to enter registrations in the "bridge" database ensures that no error occurs in entering the student ID number in the match or "key" field. It also allows you to view related seminar information and create drop-down lists based on values in the Seminars database to facilitate seminar selection.
1. Select View->Layout Mode. Select the Student Data layout and click on the Portal tool and draw a portal below the existing fields on the Student Data layout. In the Portal Setup dialog box, select Registrations as the relationship to "Show Records From" , enter 3 for the number of Rows to show and check the "Allow Deletion of portal records" (in case someone makes a mistake during data entry). Click "OK".
2. Add the fields "Seminar #" from the Registrations table and "Seminar Title" from the Seminars table to the first row of the portal.
3. Since we don't wish to refer to a list of seminar numbers to identify the Seminar a student enrolls in, we define a value list that includes the Seminar Title in its display. Click on the "Seminar #" field and select Format -> Field Format. Click on the Pop-up List radio button and select Define value list. Click "New".
4. In the define value list dialog box click the "Use values from field" radio button and specify the "Seminars" table and the "Seminar #" field in "Use Values from Field" list. Check the "Also display values from" checkbox and select "Seminar Title" from the field list. Also click the Sort by second field radio button. Click "OK".
5. Now select View -> Browse Mode. Click in the "Seminar #" field in the first row of the Portal and select a Seminar Title. You will notice that the Seminar Title field will fill in automatically.
6. Now select Window -> Registrations. You will see a record has been created that includes the Student ID and the Seminar ID.
Summarizing Records in a Portal
Information collected in a database is much more useful if you can summarize the data and this applies to portals as well. This exercise demonstrates how to summarize records in a portal. We will define a calculated field to count the number of students registered in each school on a layout with a portal containing student information.
1. Choose the Schools layout and select View->Layout Mode.
2. Choose File -> Define -> Database and select the Fields tab. Type "Student Count" for the field name, select Calculation for the field type and click Create.
3. In the Specify Calculation dialog box double click "Count" in the functions list on the right side of the dialog box. Then choose the related file Students from the drop-down list on the left side of the dialog box and select the field "Last Name" from the field list.
4. Make sure "Number" appears in the "Calculation Result Is" drop-down list. Click "OK" and "Done".
5. Select View -> Browse Mode.
Your student count should be equal to the number of student records in the portal. 6. Note: The summary field must be OUTSIDE the portal. Also, you can use any field that will not have any blank entries for the Count field. The Count function does not count blank fields.
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