Building the error pages
You can create the following error pages based on the actions and
privileges you set for your Web audience:
- a Search Error page for errors that occur while processing a
search request.
- a Record Detail Error page for errors that occur while
processing a request to edit, delete, or duplicate records.
- a New Record Error page for errors that occur while processing
a request to create a new record.
Displaying error information
To display error information generated by FileMaker Pro:
- Create a new blank page.
- Choose FileMaker
Form Library from the View menu (Windows) or the Window
menu (Macintosh).
- Select the entry for the error page you want:
- Error handling
in the
Search Error Page section
- Error handling
in the
Detail Error Page section
- Error handling
in the New
Error Page section
- Select the FMP-CurrentError tag, and then drag the tag to your
Error page.
- Type supporting text in the error page. For example, "An error
of type FMP-CurrentError occurred."
- Save and name the error page as it corresponds to the
action.
The names of the error pages must correspond with the filenames
used in the form pages where the action is initiated, and as
specified by the -Error tag. For example, the Search page might
have the filename, "search.htm" and it may refer to the error
page, "search_error.htm."
Handling errors
You can use the FMP-If tag to handle errors and display error
messages conditionally. This can be useful for providing meaningful
feedback to your Web audience when an error occurs.
To handle errors conditionally:
- Open the error file you want to edit.
- Open the FileMaker
Form Library.
- Select the entry for the error page you want:
- Error handling
in the
Search Error Page section
- Error handling
in the
Detail Error Page section
- Error handling
in the New
Error Page section
- Select the FMP-If tag, and then drag it onto your error
page.
- Double-click the FMP-If tag to display its object editor.
- Type the condition for the error tag in the Condition text box. Use the
following syntax (in this case, the example pertains to a search
error where zero records are found):
currenterror.eq.401
- Close the FMP-If tag object editor to apply the setting.
- Place the insertion point so that it is inside the FMP-If tag
area, and then type the message that will display when the
condition is met.
The FMP-If area can contain CDML tags.
- Save and name the error page as it corresponds to an
action.
The names of the error pages must correspond with the filenames
used in the form pages where the action is initiated and as
specified by the -Error tag. For example, the New Record page
might have the filename, "new_record.htm" and its error page might
be "new_record_error.htm."
This example tests for error number 401, which corresponds to zero
records found. See the FileMaker Pro error code numbers in the
FileMaker Pro online Help topic "Status(CurrentError) function" for
possible results. See the following section for a list of comparison
operators, such as .eq.
To add to this example and test for additional errors:
- Add an FMP-If tag for every additional test.
Alternatively, you can use the FMP-If/FMP-Else tags to display a
message if the condition is true and another message if the condition
is false.
Previous topic |
Contents | Next
topic