Sub Postopen(Source As Notesuidocument)
If ( source.FieldGetText( "CheckedOut" ) = "Yes" ) Then
Messagebox("This document is currently checked out.")
End If
End Sub
Sub Postopen(Source As Notesuidocument)
Dim dateTime As New NotesDateTime( "Today" )
If source.IsNewDoc Then
Call source.FieldSetText _
( "ProblemHistory", _
"Problem opened on " & dateTime.LocalTime )
End If
End Sub
このスクリプトが実行されるには、ファイル LSCONST.LSS をインクルードしなければなりません。
Sub Postopen(Source As Notesuidocument)
Dim ownerType As String
Dim employeeRequest As String
Dim result As Integer
If source.EditMode Then
ownerType = source.FieldGetText( "Owner" )
Select Case ownerType
' 1. Employee enters the request in a dialog box
Case "Employee":
employeeRequest = Inputbox$ _
( "Please enter your request", "Request" )
Call source.FieldSetText("Request", employeeRequest)
Call source.FieldSetText("Owner", "Manager")
' 2. Manager approves or rejects the request
Case "Manager":
result = Messagebox _
( "Do you approve this employee's request?", _
MB_YESNO, "Approve" )
If ( result = IDYES ) Then
Call source.FieldSetText( "Status", "Approved" )
Else
Call source.FieldSetText( "Status", "Rejected" )
End If
Call source.FieldSetText("Owner", "Human Resources")
' 3. Human Resources approves or rejects
' the Manager's decision
Case "Human Resources":
result = Messagebox _
( "Do you approve this manager's decision?", _
MB_YESNO, "Confirm" )
If ( result = IDYES ) Then
Call source.FieldSetText _
( "Confirmation", "Approved" )
Else
Call source.FieldSetText _
( "Confirmation", "Rejected" )
End If
End Select
' After each step, the document is saved and closed
Call source.Save
Call source.Close
End If
End Sub