Manage Learn to apply best practices and optimize your operations.

The best $$ReturnGeneralError

How to make integrated error handling look nice in a Domino Web application.

How does one integrate error handling in a Domino Web application and make it look good? Create a $$ReturnGeneralError form that will trap all errors generated by the Domino application. The form shall have two hidden fields:

  1. SaveOptions computed when composed to "0". This will unable any user to create a new document based on this form.
  2. MessageString having the default value MessageString. This field will contain the generated error massage.
Now put your JavaScript skills to work and write four simple lines:

<Script>
    alert("[MSG_disp]");
    history.go(-1);
</Script>
The [MSG_disp] is a computed for display field containing this formula:
@ReplaceSubstring(MessageString; "-"; ":n")
Make the whole part pass though HTML, and you're done.

The finished result will display a pop-up alert message for the user. The error message is split on two lines to make it easier to read, and after the user clicks OK, the browser will back up one screen, allowing the user to fix whatever caused the error.

Do you have comments on this tip? Let us know.


Dig Deeper on Web Development for Lotus Notes Domino

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close