Hi,
i would like to know how i should do the script when i wanted the user to attach a doclink in a specific field when DueDate is less than 3 days of DateComposed. I have the script below but the problem is after the error message prompted, when the user attach the doclink, the error message prompt again. i don’t know if i should use a looping here…here’s my script:
Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim todayDateTime As NotesDateTime
Dim dueDateTime As NotesDateTime
Dim daysLeft As Long
Call source.Refresh
Set todayDateTime = New NotesDateTime( source.FieldGetText("DateComposed") )
Set dueDateTime = New NotesDateTime ( source.FieldGetText( "DueDate" ) )
daysLeft = ( dueDateTime.TimeDifference ( todayDateTime ) ) / 86400
If daysleft < 3 Then
If source.document.HasItem("Reason") Then
Set varBody = source.document.GetFirstItem("Reason")
If source.document.HasItem("$Links") Then
Set varLinks = source.document.GetFirstItem("$Links")
Else
Messagebox "Please attach a link in the Reason field"
continue = False
End If
End If
End If
Exit Sub
End Sub