.
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: QuerySave event
1. This script prevents the user from saving the current document if there is nothing in the Title field. It displays a message and moves the insertion point to the Title field.
Sub Querysave(Source As Notesuidocument, _
Continue As Variant)
If ( source.FieldGetText( "Title" ) = "" ) Then
Messagebox( "You must enter a title." )
Call source.GotoField( "Title" )
continue = False
End If
End Sub
2. This script checks the contents of the dueDate field when the user tries to save the current document, and updates the ProjectStatus field accordingly. If the dueDate is less than four days away, it puts "Urgent" into the ProjectStatus field; if it's less than six days away, it puts "Hurry up a little" into the field; if it's six or seven days away, it puts "No worries" into the field.
Sub Querysave(Source As Notesuidocument, _
Continue As Variant)
Dim targetDate As String
Dim todayDateTime As NotesDateTime
Dim dueDateTime As NotesDateTime
Dim daysLeft As Long
Call source.Refresh
Set todayDateTime = New NotesDateTime( "Today" )
Set dueDateTime = New NotesDateTime _
( source.FieldGetText( "dueDate" ) )
daysLeft = ( dueDateTime.TimeDifference _
( todayDateTime ) ) / 86400
Select Case daysLeft
Case 1, 2, 3:
status = "Urgent"
Case 4, 5, 6:
status = "Hurry up a little"
Case 6, 7:
status = "No worries"
End Select
Call source.FieldSetText( "ProjectStatus", status )
End Sub
See Also
QuerySave event
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Feedback on
Help
or
Usability
?
Help on Help
All Help Contents