How to change a field value of a document (LotusScript)?

Posted by Vassilen Dontchev on Stack Overflow See other posts from Stack Overflow or by Vassilen Dontchev
Published on 2010-01-28T23:16:28Z Indexed on 2010/03/30 13:03 UTC
Read the original article Hit count: 425

Filed under:
|

Hello. In a new LotusNotes form I have a computed-value field ("NewOrdProdUID") which is set correctly with the unique ID of another existing document. I want to change the value of the field "NewProdAvail" in the existing document by means of LotusScript. I tried with this:

Sub Querysave(Source As Notesuidocument, Continue As Variant)
 Dim session As NotesSession
 Dim db As NotesDatabase
 Dim ws As New NotesUIWorkspace
 Dim uidoc As notesUIDocument
 Dim odoc As notesDocument 

 Set session = New NotesSession
 Set db = session.CurrentDatabase
 Set uidoc = ws.CurrentDocument

 Set odoc = db.GetDocumentByUNID(uidoc.FieldGetText("NewOrdProdUID"))
 Call odoc.FieldSetText("NewProdAvail", "0")
 Call odoc.Save(True, True)
End Sub

However the value of the field "NewProdAval" stays the same (3 in my case, not 0). Please, help me!

© Stack Overflow or respective owner

Related posts about lotusscript

Related posts about lotus-notes