Filemaker Pro Lesson

Script Writing:

Combining Predefined and User-defined criteria in a Find Script

This exercise requires the file Registrations3.fp7.

Often, you may wish to incorporate a user defined criteria with preset report criteria. This involves creating global fields to hold the user specified data then initiating script steps to insert the user criteria along with program criteria into a Find.

1. Using the Registrations3.fp7 file, select File -> Define -> Database and click on the Fields tab. Create a text field called "Select Event" and click the Option button and select the storage tab. Check the Use global storage checkbox.

2. Now, choose View - > Layout Mode and select Layouts -> New Layout/Report. Name your layout "Report Criteria" and select "Blank Layout" and click Finish. Click on the Field tool and drag a field object over to the center of the body section of your new layout. Choose the field "Select Event". Now click on the Text Tool and type "Please enter the event desired".

3. Select Scriptmaker. Click on the script "Create Participant List" and click the Edit button. Click on the first script step, "Go to Layout" and select the layout "Report Criteria".

4. Now scroll down the list of script actions and double-click the script step "Pause, Resume Script" then double-click the script step "Go To Layout" and select "Participant List" from the list of layouts.

5. Now delete the Perform Find script step and doubleclick the script step "Enter Find Mode" in the left hand window.

6. Now, double click on "Set Field" action in the left hand window, click on the Specify field button and select the field "Event" . Then click the Specify button below the first Specify button and double click the field "Select Event" from the list of available fields in the left hand window.

7. Scroll down the list of script actions on the left and double-click the script step "Set Field" again. Select the field "Past Participant" then click the Specify button and enter "Y". (We're going to make this a past partipant list. Don't forget the quotation marks or Filemaker will think you are referring to a field name).

8. Now scroll down the list of script actions on the left and double-click the script step "Perform Find". and click OK and Done.

9. From the list of layouts above the flip book, choose the "Participant List" layout.

10. Select the Text Tool and double click on the Report Title and change it to "Past Participant List".

11. Select Scriptmaker - > Prepare Participant List to see the result. You would probably also want to change the script name to "Prepare Past Participant List" since it now includes a predefined criteria for Past Participants = "Y". Select Scriptmaker. Click on the "Prepare Participant List" script. In the script name box insert the word Past then click the Rename button.

 


 

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