Object Variable Not Set

If you set a object variable be sure that it’s really set.
It’s always a pleasure for a user to get a ‚object variable not set‘ error box.

Dim session As New NotesSession Dim db As NotesDatabase Dim DecisionDoc As NotesDocument Dim strID As String Set db = session.CurrentDatabase Set view = db.GetView("(IDs)") Set DecisionDoc = view.GetDocumentByKey(id, True) Call DecisionDoc.ReplaceItemValue("ShortName","1A")
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.

Better Style:

Dim session As New NotesSession Dim db As NotesDatabase Dim DecisionDoc As NotesDocument Dim strID As String Set db = session.CurrentDatabase Set view = db.GetView("(IDs)") if not view is Nothing then Set DecisionDoc = view.GetDocumentByKey(id, True) if not DecisionDoc is Nothing then Call DecisionDoc.ReplaceItemValue("ShortName","1A") Else ErrorhandlingDecisionDoc End if Else ErrorhandlingView End if
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.