.
HCLSoftware Business Partner
Domino Consulting Services
CRUCIAL Notes Tools
+1
212-599-2048
Domino Consulting Services
CRUCIAL Notes Tools
Domino administration
Notes development
Chat now
.
EN - English
CN - 中文
JP - 日本語
DE - Deutsch
FR - Français
BR - Português
RU - Pу́сский
IT - Italiano
IN - हिन्दी
ES - Español
KR - 한국어
ID - Indonesia
NL - Dutch
TR - Türkçe
SA - العربية
SE - Svenska
NO - Norsk
PL - Polski
TH - ไทย
DK - Dansk
MY - Malay
PH - Filipino
GR - Ελληνικά
FI - Suomi
IL - עברית
IE - Gaeilge
CZ - Čeština
UA - Українська
RO - Română
VN - Tiếng Việt
BD - বাংলা
HU - Magyar
Need a Domino Consultant? Call NotesMail +1 212-599-2048
-
HCLSoftware Business Partner
LOTUSSCRIPT/COM/OLE CLASSES
Examples: Save method
1. This script creates and saves a new document in the current database. Because the document is new, there is no chance of conflicting edits, so the first parameter is False.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
doc.Form = "Main Topic"
doc.Subject = "Here's a new document"
Call doc.Save( False, False )
2. This view action script changes the Status item on each document selected in a view. If someone else edits one of the documents at the same time, the document is not saved. Instead, a response document that contains the change to the Status item is created and saved.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()
While Not(doc Is Nothing)
doc.Status = "Processed by view action"
Call doc.Save( False, True )
Set doc = collection.GetNextDocument( doc)
Wend
3. This view action script changes the Status item on each document selected in a view. If someone else edits one of the documents at the same time, the document is not saved. For each selected document, the script displays a message informing the user if the document was saved or not.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()
While Not(doc Is Nothing)
doc.Status = "Processed by view action"
If doc.Save( False, False ) Then
Messagebox "Document " & doc.UniversalID & _
" successfully saved"
Else
Messagebox "Document " & doc.UniversalID & _
" was not saved"
End If
Set doc = collection.GetNextDocument( doc)
Wend
4. This script changes the Status item in a document. Because the first parameter is True, the document gets saved, even if someone else edits the document while the script runs.
Dim doc As NotesDocument
'...set value of doc...
doc.Status = "This change gets saved no matter what"
Call doc.Save( True, True )
See Also
Save method
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Feedback on
Help
or
Usability
?
Help on Help
All Help Contents