I have a field named “implementation date” on a form. I want to make sure that the date that is being entered is not greater than today’s date. I am having trouble figuring out the best formula to use and where the formula should be placed.
Any help would be greatly appreciated!
Thanks!
Subject: Check to see if a date is greater than today when entered into field
Try something like this LotusScript on the exit event of the field or put it in the Queary save event of the form.
Dim InputDate As NotesDateTime
Dim FutureDate As NotesDateTime
Set FutureDate = New NotesDateTime( “Today” )
Set InputDate = New NotesDateTime( “” )
Call FutureDate.AdjustDay( 1 ) 'adjusts to tomorrow
InputDate.LSLocalTime = doc.implementationDate(0)
'Check that implementation date cannot be in the future or blank
If (doc.implementationDate(0) =“” ) Then
msg = msg + Chr(10) + “IMPLEMENTATION DATE ISSUE” & Chr(10) & Chr(9) + “- Implementation Date can not be blank”
Elseif InputDate.DateOnly>= FutureDate.DateOnly Then
msg = msg + Chr(10) + " IMPLEMENTATION DATE ISSUE " & Chr(10) & Chr(9) + “- Implementation Date Date cannot be in the future.”
End If
If msg <> “” then
msgBox msg
'Do something else here like putting the focus back on the field
End if
You will probably need to debug this to get the kinks out
Mike
Subject: Take a look at “Input Validation Formula” in Domino designer help
You’ll need something like this:@If(FieldIamTesting<@Today; @Success; @Failure(“The date cannot be later than today”))
Subject: RE: Take a look at “Input Validation Formula” in Domino designer help
And this should go into your input validation. However, it won’t fire until the document is saved or refreshed.
Subject: RE: Take a look at “Input Validation Formula” in Domino designer help
Thank you very much for your help. Do you know how I get rid of this error?
Notes Error: Fields didn’t pass validation formula