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

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close