Hi All,
I would like to know how can I set a field in a document base on Document Unique ID using LotusScript. The function should be like @SetDocField. Please advice.
Hi All,
I would like to know how can I set a field in a document base on Document Unique ID using LotusScript. The function should be like @SetDocField. Please advice.
Subject: Set document field in LS
As stated in the Notes Designer help database:
To get a document based on its note ID or UNID, use GetDocumentByID or GetDocumentByUNID in NotesDatabase.
So your code will look like:
Sub SetDocField (FieldName as String, UniqueID as String, NewValue as Variant)
Dim session as New NotesSession
Dim db as NotesDatabase
Set db = session.CurrentDatabase
Dim doc as NotesDocument
Set doc = db.GetDocumentByUNID (UniqueID)
Call doc.ReplaceItemValue (FieldName, NewValue)
Call doc.Save (True, True)
End Sub
Best of luck,
Nicolas Abesdris
Quintessence e-solutions Inc.