.
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: OnLoad event
1. This OnLoad event displays a message if the current document's CheckedOut field contains "Yes."
Sub Onload(Source As Notesuidocument)
If (Source.FieldGetText("CheckedOut") = "Yes") Then
Messagebox "This document is checked out",, "Check out"
End If
End Sub
2. This OnLoad event writes the time to the ProblemHistory field if the current document is new.
Sub Onload(Source As Notesuidocument)
Dim dateTime As New NotesDateTime("Today")
Call dateTime.SetNow
If Source.IsNewDoc Then
Call Source.FieldSetText _
("ProblemHistory", _
"Problem opened on " & dateTime.LocalTime)
End If
End Sub
3. This OnLoad event processes a document opened for editing in three stages:
If the Owner field contains "Employee," the event gets the Request field text and changes the Owner field to "Manager."
If the Owner field contains "Manager," the event gets the value "Approved" or "Rejected" for the Status field and changes the Owner field to "HR."
If the Owner field contains "HR," the event gets the value "Approved" or "Rejected" in the Confirm field.
%INCLUDE "lsconst.lss"
Sub Onload(Source As Notesuidocument)
Dim ownerType As String
Dim employeeRequest As String
If Source.EditMode Then
ownerType = Source.FieldGetText("Owner")
Select Case ownerType
Case "Employee"
employeeRequest = Inputbox$ _
("Enter your request", "Request")
Call Source.FieldSetText("Request", employeeRequest)
Call Source.FieldSetText("Owner", "Manager")
Case "Manager"
If Messagebox _
("Do you approve this request?", _
MB_YESNO, "Approve") = IDYES Then
Call Source.FieldSetText ("Status", "Approved")
Else
Call Source.FieldSetText("Status", "Rejected")
End If
Call Source.FieldSetText("Owner", "HR")
Case "HR"
If Messagebox _
("Do you confirm this decision?", _
MB_YESNO, "Confirm") = IDYES Then
Call Source.FieldSetText("Confirm", "Approved")
Else
Call Source.FieldSetText("Confirm", "Rejected")
End If
End Select
Call Source.Save
Call Source.Close
End If
End Sub
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Feedback on
Help
or
Usability
?
Help on Help
All Help Contents