Displaying a customized error message on the Web

To customize the appearance of error messages that display to Web users, add custom error message forms to the database. If an error condition occurs and a custom form exists for it, Domino® uses the custom form to display the error message. Otherwise, Domino® uses the default error message form. Message forms that you add to a database override any server-wide messages set up by an administrator.

To create the association between a form and an error condition, create a form with one of the following names. Then create an editable text field named MessageString to hold the error message. Add additional text, links, and other form objects that you want to display with the error message.

Form name

Condition

$$ReturnAuthenticationFailure

The user's name and password cannot be verified.

$$ReturnAuthorizationFailure

The user does not have a sufficient access level for the database.

$$ReturnDocumentDeleted

A document was successfully deleted.

$$ReturnGeneralError

Any other error condition has occurred.

Adding the message field

Create one of the following fields to hold the error message:

  • An editable text field named MessageString to display the default server-generated error message.
  • A computed-for-display field whose formula replaces the default error message with a customized message.

    For example, this formula for a field named CustomString on a $$ReturnAuthenticationFailure form gives more information to the user if authentication fails. The formula takes the value from the default MessageString field if it contains "unauthenticated" and replaces it with instructions to the user. If the MessageString field does not contain the word "unauthenticated", Domino® uses the value of MessageString instead.

    @If(@Contains(messagestring;"unauthenticated");"Sorry, the name and password you entered are unknown in our system. If you are new to our site, return to the home page and follow instructions for registering.";messagestring)