Problem solve Get help with specific problems with your technologies, process and projects.

Help us retrieve error message in R6

After upgrading to Notes 6.5.3, a reader is no longer able to examine an error message. He turns to a SearchDomino expert to help him retrieve this error message in a string.

In some applications, it is necessary for me to test for the error "Entry not found in index." In Notes R5 I was able to examine the error message using @text. But then my company upgraded to Notes 6 (v6.5.3). Some of my Formula code immediately broke. Now, in R6, the error message appears to have been changed to "Server Error: Entry not found..." and @text returns only an empty string.

I have tried everything I can think of, including @implode, @texttonumber, etc., but nothing works and I can't find any help on the IBM/Lotus website. As a workaround, I am trapping the empty string since @text seems to work for other obvious errors, e.g., "Server not found." However, this worries me as I don't know what other errors now return the empty string. Can you help me retrieve this error message in a string?

View member feedback to this Ask the Expert Q&A.

It's hard to know for sure without seeing any of the code, but the bug that I've seen that causes a lot of formulas to stop working in R6 has to do with temporary field variable initialization.

Prior to R6, if you wanted to refer to a field in certain formulas, you had to define the field value as a variable, like this:

FIELD some_field_name := some_field_name;

In R6, you no longer need this type of initialization. In fact, it causes subsequent references to the field not to work!

If you are using a field initialization and then trying to pass that field value in an @DBLookup, you would essentially be trying to look up a document based on a null lookup value.


If I understand the problem mentioned correctly, then the following solution might be much easier to use. Since R6 the @IfError formula can be used to trap possible errors when using, for example, @DbLookup. The Help Designer documentation provides a good example on how to use this function.

—Lars P.


@If(@IsError()... may be used to trap an error, but that still doesn't allow the @DBLookup to work in the first place. The field whose value you are trying to pass as the key for the lookup cannot be referenced properly, due to the variable assignment bug.

Brad Balassaitis


I'm afraid the answer did not really address the actual problem, although I appreciate the tip. Here is sample code that causes the error in my application:

@Text( @DbLookup( "":"NoCache"; "server":"names.nsf"; "People"; "garbage"; 1 ) )

If I run this, even using shift+F9, it returns an empty string. The actual error is "ERROR: Server error: Entry not found in index". In R5 the error was "ERROR: Entry not found in index" and @Text returned "Entry not found in index". I was able to trap this and examine it. Now I am highly frustrated because of the empty string.

—Jack S.


You are better off trapping the error by using a new feature of the @DBLookup function in R6. Use the [FAILSILENT] keyword to force @DBLookup to not return an error if it cannot find the key value specified.

Brad Balassaitis


I can certainly find out IF an error has occurred. The essence of error trapping, however, is to know WHAT error was returned, as this affects the choices in the remainder of the code. In R5 this could be done. In v6, some, not all, of the errors return an empty string which is totally useless for error trapping purposes

OK, I studied the [FAILSILENT] keyword. It appears that it only returns the empty string when the key is not found. Other errors are returned as before. This will allow me to trap the error I need. Thank you for that information.

I would like to know why IBM/Lotus had to change something that worked perfectly well for many years, apparently merely for the sake of change! And, if not for the sake of change, then why was it changed at all.

If I needed to trap the error "File not found", for example, I would again be faced with the dreaded empty string. New versions should enhance the old version, not break it. The previous error message was perfectly clear and unambiguous, SO WHY CHANGE IT? If anyone at Lotus is listening, please enlighten me.

—Jack S.

Do you have comments on this Ask the Expert question and response? Let us know.

Dig Deeper on Lotus Notes Domino Formula Language

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • 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 ...