Hi,
I have a start date and an end date. I’m trying to setup a rule. If end date is less than 5 days old, a pop up box will appear asking if the is a emergency change. if yes is selected another field will be populated and date will be accepted if not user will be required to re-enter the end date. Hope this makes sense …
Code I’ve started so far
Sub Exiting(Source As Field)
Dim ws As New NotesUIWorkspace
Dim UIDoc As NotesUIDocument
Set UIDoc = ws.CurrentDocument
Set Doc = UIDoc.Document
If Doc.ImpDateField(0) = "" Or Doc.ImpChgDateRequired(0) = "" Then
Msgbox "Please enter a date value in the Imp Change Date."
Exit Sub
End If
Set StartItem = Doc.GetFirstItem("ImpDateField")
Set StartDateTime = StartItem.DateTimeValue
Set FinishItem = Doc.GetFirstItem("ImpChgDateRequired")
Set FinishDateTime = FinishItem.DateTimeValue
TimeDiff = FinishDateTime.TimeDifference( StartDateTime )
Msgbox TimeDiff/86400
If TimeDiff/86400 <= 5 Then
......
End If