When running a webQuerySave agent, I am trying to set the value of a field to be 14 days from NOW.
I am getting data type mismatch.
Can anyone advise? Here is the code :
’ set up date variable with today’s date
Dim geDateOverdueVar As New NotesDateTime(Now)
’ adjust the date in the variable - to be plus 14 days…
Call geDateOverdueVar.AdjustDay( 14 )
’ replace field value on my form with contents of the variable
doc.geActionedDateOverdue = geDateOverdueVar
I will also need to do this process again in another agent where I set the value of one field to be the value of another date field (rather than NOW : i.e. date2 = date1 plus 14 days)
if anyone can assist - much appreciated. The fields in question are DATE fields (EDITABLE)
Use the Variant date setup for simplicity. The integer portion of the date represents days while the fractional section represents the fraction of a day.
Dim dt as variant
dt = Today + 14
doc.geActionedDateOverdue = dt
or more simply …
doc.geActionedDateOverdue = Today + 14
To use another field,
doc.Date2 = srcdoc.Date1(0) + 14
The field type as date is automagically inferred in the first case from the use of Today, and in the second from the date type of the Date1 field.