Manage Learn to apply best practices and optimize your operations.

Error Handling on Web LotusScript agents

When running LotusScript agents on the web there is no access to a script debugger.

Using the Erl and Error functions within LotusScript you can simply detect the line of your error and display it on the screen.

In a WebQueryOpen agent you cannot "print" to the screen so you can use a field (I have called it called "ErrorField") which is hidden if ErrorField="" On the WebQuerySave or in an ?openagent you can print the error to the Screen.

This also works if the errorhandling is added into functions within the agent as well as the Initialize.

 Sub Initialize On Error Goto ErrorHandler Dim session As New notessession Dim doc as notesdocument Dim db as notesdatabase Set doc=session.documentcontext Set db=session.currentdatabase etc etc etc etc Exit Sub ErrorHandler: Dim ErrString As String ErrString="INITIALIZE : Script Error on Line : " + Cstr(Erl()) + Chr(10)+Chr(10)+"Error Message : " + Error$ Print ErrString 'In WebQueryOpen agent use doc.ErrorField=ErrString Exit Sub End Sub

(When adding the errorhandling into a function replace INITIALIZE with the name of your function to differentiate between failure points)

Dig Deeper on Domino Resources - Part 4

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