hcl-bot
November 5, 2007, 10:01am
1
Hi,I’m looking for a code to read and to write values in a document, directly from a selected document in a view trought a Button function.
I tried with the following Agent-code using notesuiview class:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim workspace As New NotesUIWorkspace
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim uiview As NotesUIView
Set db = session.CurrentDatabase
Set uiview = workspace.CurrentView
Set collection = db.AllDocuments
Set doc = collection.GetFirstDocument
myFld = doc.MyField(0)
messagebox myFld
doc.montaggio_txtStatoDoc = “read”
Call doc.Save(True,False)
but I’ve a empty value. MyFld variable is empty and the field havn’t been modified.
Someone can help me ??
Thank you
hcl-bot
November 5, 2007, 10:59am
2
Subject: Modify value from a view
Use “db.UnprocessedDocuments” to get collection of documents selected in a view and process them! All documents will return all the documents in a database.
Dim session As New NotesSession
Dim db As NotesDatabase
'Dim workspace As New NotesUIWorkspace
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
'Dim uiview As NotesUIView
Set db = session.CurrentDatabase
'Set uiview = workspace.CurrentView
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument
While Not doc is nothing
myFld = doc.MyField(0)
messagebox myFld
doc.montaggio_txtStatoDoc = “read”
Call doc.Save(True,False)
set doc = collection.getNextDocument(doc)
Wend
Hope this helps!
Thanks,
Bruno!
hcl-bot
November 5, 2007, 11:09am
3
Subject: RE: Modify value from a view
Thank you very much!!!It’s ok!!