Monday, February 18, 2013

Lotus Notes error:- “Object Variable not set”

Lotus Notes is a client server application that includes address book, emails, calendaring and scheduling, web server and programming, attachments and many more components.

Sometimes when you open Lotus Notes client you find the following error message on the screen:-
Object Variable not set”

The main reason behind the occurrence of this error is trying to use an object variable that has not been set to any value. Generally this error comes in Lotus Script.

Every problem has its solution so to solve this problem you will have to take help from the developer of the database.

As a developer you have to turn on the LotusScript debugger. After this you have to follow the steps to re-create the error. The Variables tab which has not been set in the debugger will help you to identify the object variable.

You can use the On Error statement to trap the error and display the error line number if it is not possible to debug the code.

When you identified the error line number, you can easily find the problem with the help of ".". For example:

Set doc = view.GetDocumentByKey(keys(0))

In this you are seeing that variable view has the value Nothing. You can see here the coding error that is responsible for the problem is not on this line. Perhaps the variable was never assigned, or you have misspelled the name here or elsewhere, or perhaps it has been assigned with the value Nothing. Suppose the variable was earlier assigned with the statement:

Set view = db.GetView("lkByDocID")

and there is no view named lkByDocID. There is no error on this line, but the variable view is assigned the value Nothing. Later, you have an error when you are using the variable view for an object reference operation.

Options to avoid this problem:
  • Use On Error to trap the error and take corrective action (or at least print a more specific error message).
  • IF you use Option Declare in all your scripts, this will help you in catching any misspellings of variable names during compile and will save much time.
  • Pay attention to where object variables are deleted and think about what other objects might depend on them.
  • You can adopt Is Nothing to test whether the object variable has a useful value or not before you are going to try.
If you are searching for help from commercial tool for NSF recovery then you can try Stellar Phoenix Lotus Notes Recovery. This is a very economic utility that provides Lotus Notes recovery within no time. Stellar is #1 data recovery organization that provide 24*7 support for assistance and there is facility to return money if software doesn't work properly.