.
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: SavedData property
1. This script gets the SavedData document for the current agent script and sets its RunDate item to today's date.
Dim session As New NotesSession
Dim doc As NotesDocument
Set doc = session.SavedData
doc.RunDate = Date
Call doc.Save( True, True )
2. This agent script compares the maximum number of leads generated by a salesperson in the current week with the maximum number of leads generated last week. The script checks a view that contains Lead documents filled out by each salesperson. The first column in the view sorts the number of leads generated by each salesperson in descending order, so that the Lead document with the highest number of leads is first in the view. The NumLeads item on this document (which represents the maximum number of leads generated this week) is compared with the MaxLeads item on the SavedData document (which represents the maximum number of leads generated last week), and the Summary item is updated accordingly. The MaxLeads item on the SavedData document is then updated and both documents are saved.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc, agentDoc As NotesDocument
Dim d As Integer
Set db = session.CurrentDatabase
Set view = db.GetView _
( "This week's leads by salesperson" )
' first document in view has the most leads
Set doc = view.GetFirstDocument
Set agentDoc = session.SavedData
' the first time agent runs,
' there are no items on SavedData
' so set the MaxLeads item to zero
If Not( agentDoc.HasItem( "MaxLeads" ) ) Then
agentDoc.MaxLeads = 0
Call agentDoc.Save( True, True )
End If
d = doc.NumLeads( 0 ) - agentDoc.MaxLeads( 0 )
If ( d > 0 ) Then
doc.Summary = Abs( d ) & _
" more leads than last week's max."
Elseif ( d < 0 ) Then
doc.Summary = Abs( d ) & _
" less leads than last week's max..."
Else
doc.Summary = _
"You matched last week's max number of leads."
End If
' put this week's max leads onto SavedData
agentDoc.MaxLeads = doc.NumLeads
Call doc.Save( True, True )
Call agentDoc.Save( True, True )
End Sub
See Also
SavedData property
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Feedback on
Help
or
Usability
?
Help on Help
All Help Contents