Domino Code Fragment

Code Name*
A WAIT FUNCTION???
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.22.100.180
Description*
Yes, you'll need to use script and set up a NotesTimer in the form initialize event, when the timer expires it can check the field in the UIDoc and close the whole lot down if there is nothing there....
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Put this in the Forms Global Declarations

Dim elapsedTimer As NotesTimer
%INCLUDE "lsconst.lss"


This is the forms's postopen event

Sub Postopen(Source As Notesuidocument)
Set elapsedTimer = New NotesTimer(30, "Elapsed time since opening document")
On Event Alarm From elapsedTimer Call elapsedTimerHandler
End Sub


And this is teh event handler this is a test version, obviously you can amend its action accordingly Field_1 is the field to be tested

Sub elapsedTimerHandler(Source As NotesTimer)
Dim Wspace As New NotesUIWorkspace
Dim UIDoc As NotesUIDocument
Set UIDoc = WSpace.CurrentDocument
Dim Field1 As String


Field1 = UIDoc.FieldGetText("Field_1")
If Field1 = "" Then
Messagebox "Field not filled in"
Call UIDoc.Close
Else
Messagebox "Field Filled in"
End If
End Sub