Hi! All,
I am trying to get the value of newly create document through lotus script it return error object variable not set.
What I did I have a from which create document on submit. I used
@do(@command([filesave]);@command([toolsrunmacro];“createdocuemnt”)
I wrote an agent in lotus script where i copy this newly created document to the another database named “user.nsf”
my lotus script is:
dim doc as notesdocument
dim session as new notessession
Set doc=session.DocumentContext
Dim userDoc As NotesDocument
Dim userDb As NotesDatabase
Set userDb = New NotesDatabase("","User.nsf")
Call doc.CopyToDatabase(userDb)
call doc.save(true,true)
this code copy the current document to user.nsf because when i open the view this document shows the document.
now below this i used additional code:
Set userDb = New NotesDatabase("","User.nsf")
Dim UserView As NotesView
Dim newuserDoc As NotesDocument
Set UserView = userDB.GetView("userRegistration")
UserView.Refresh
Set newuserDoc = UserView.GetDocumentByKey(doc.emailID(0))
If Not (newuserDoc Is Nothing) Then
Msgbox "document not found"
Else
Msgbox "inside"
Msgbox newuserdoc.UniversalID
Msgbox newuserdoc.emailID(0)
end if
after executing this code it goes inside the else part and at server console it prompt “inside” so that is clear that it fetch the document sucessfully. but when control goes to next line
msgbox newuserdoc.emailID(0)
or
msgobx newuserdoc.UniversalID
it show message on server consloe
object variable not set.
can any help me please. Where i doing wrong.
Actuallly I want to get the document id of the newly created document.
Please help…
Its an urgent
With Regards,
Vikas K Sinha