Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

Previous Next
Subject: Persnickety LotusScript Error
Feedback Type: Problem
Product Area: Notes Client
Technical Area: Application Development
Platform: Windows
Release: 8.5.1
Reproducible: Always

Hi guys, I'm a newbie to script and looking for some help troubleshooting an agent. I copied a client-run agent (that works fine) to perform a slightly different function. This new agent is throwing an error ('Object variable not set').
In debug mode the failure happens quite early on at 'If item.Values(0)<>"" Then' so I'm guessing I've declared something wrong, but can't seem to figure out what. Any help would be greatly appreciated ;)

Dim conn As Variant
Dim sRoot As String
Dim rs
Sub Initialize

Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument

Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()

While Not(doc Is Nothing)
UpdateDoc = False
Set item = doc.GetFirstItem( "ShortName" )

If item.Values(0)<>"" Then strADResult = GetADAccount(item.Values(0),"title")
If strADResult <> "" And doc.HasItem("JobTitle") Then

If Replace(strADResult,","," ") <> doc.GetItemValue("JobTitle")(0) Then
Call doc.ReplaceItemValue("JobTitle", Replace(strADResult,","," "))
Print item.Values(0) & " - Updated JobTitle"
UpdateDoc = True
End If
End If
(and it goes on from there....)

Feedback number WEBBAU6T6Z created by Stacy Elmwood on 12/18/2017

Status: Open

Persnickety LotusScript Error (Stacy Elmwood 18.Dec.17)
. . no problem. (Mike Woolsey 18.Dec.17)
. . You want to test if item is empty (Carl Tyler 18.Dec.17)
. . . . Error trap (Barry Shapiro 18.Dec.17)
. . . . Empty?? (Stacy Elmwood 20.Dec.17)
. . . . . . Inspect using debugger (Martha Geppert 20.Dec.17)
. . . . . . . . It's there alright, but not seen? (Stacy Elmwood 21.Dec.17)
. . . . . . . . . . I wonder if it being summary protec... (Carl Tyler 21.Dec.17)
. . . . . . . . . . . . Access Level = Manager (Stacy Elmwood 21.Dec.17)
. . . . . . . . . . Look further at the field / item (Martha Geppert 22.Dec.17)
. . . . . . . . . . . . Check all documents (Alex Elliott 1.Feb.18)


Search this forum

Member Tools

RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds


Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds


IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite