Building the error pages

You can create the following error pages based on the actions and privileges you set for your Web audience:

Displaying error information

To display error information generated by FileMaker Pro:

  1. Create a new blank page.
  2. Choose FileMaker Form Library from the View menu (Windows) or the Window menu (Macintosh).
  3. Select the entry for the error page you want:
  4. Select the FMP-CurrentError tag, and then drag the tag to your Error page.
  5. Type supporting text in the error page. For example, "An error of type FMP-CurrentError occurred."
  6. 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:

  1. Open the error file you want to edit.
  2. Open the FileMaker Form Library.
  3. Select the entry for the error page you want:
  4. Select the FMP-If tag, and then drag it onto your error page.
  5. Double-click the FMP-If tag to display its object editor.
  6. 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
  7. Close the FMP-If tag object editor to apply the setting.
  8. 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.
  9. 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:

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