i want to add a new document in a lotus notes view and and want to make some of them as a response of existing one. But right now i am only able to retrive data from lotus notes but unable to write data to lotus notes. I also tried couple of example of this site but some function don’t work at my end even though i have added all the .Net Coms in the reference. By the way i am working in VB.Net (2005). like " Dim ws As New NotesUIWorkspace" don’t work at my end i also tried with different prefixes like … lotus and domino etc…
Here is my code which add a document with errors
Dim session As New Domino.NotesSession
Dim db As Domino.NotesDatabase
Dim MailDoc As Domino.NotesDocument
Call session.Initialize("goldmine")
db = session.GetDatabase("", "Test.nsf")
Dim report As Domino.NotesDocument
report = db.CreateDocument()
Call report.AppendItemValue("Form", "Contacts")
Call report.AppendItemValue("Name", "Laloo Atif")
report.Save(True, True, True)
Please make it a response of an existing one or add a new without error.
Subject: Look in the designer help for MakeResponse
Here is what it says:
This script makes the second document in a view a response to the first document in a view. It also modifies the Form item in the second document so that it displays in the user interface as a Response.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim docA As NotesDocument
Dim docB As NotesDocument
Set db = session.CurrentDatabase
Set view = db.GetView( “All documents” )
Set docA = view.GetFirstDocument
Set docB = view.GetNextDocument( docA )
Call docB.MakeResponse( docA )
docB.Form = “Response”
Call docB.Save( True, True )
So you need to find the document that you want to make as the parent, and the new doc that you are going to make a response. Also make sure that the form that you are creating the new response doc is defined as a Response document.
Subject: RE: Look in the designer help for MakeResponse
When i insert this code it gives error i.e. session not initialized but when i initialize session by adding following line of code after declation commands:session.Initialize(“goldmine”)
db = session.GetDatabase(“”, “Test.nsf”) //
But after this it also gives error message and that is “Object reference not set to an instance of an object.”