Reminder sent if overdue 5 days or more

Hi,

I have the following script, that needs to send out a reminder if the document is overdue 5 days or more. It needs to send it to them EVERY day (if 5 or more days), until they have actioned it. (the status will change). The script below does nothing, any ideas what I might be doing wrong?

Updated field formula: @If(@IsDocBeingSaved; @Now; Updated)

**

Dim s As New NotesSession

Dim db As NotesDatabase

Dim coll As NotesDocumentCollection

Dim doc As NotesDocument

Dim sF As String

Dim compdate As New NotesDateTime(Today)

Call compdate.AdjustDay(-5)

Set db = s.CurrentDatabase

sF=“Form = ‘TestForm’ & Status = ‘Test’ & @Date(Updated) <= [” & compdate.DateOnly & “] & @IsUnavailable(Deleted) & @IsUnavailable($Conflict)”

Set coll = db.Search(sF, Nothing, 0)

Set doc = coll.GetFirstDocument

Do While Not doc Is Nothing

ReminderMail

Set doc = coll.GetNextDocument(doc)

Loop

**

Thank you in advance.

Subject: Reminder sent if overdue 5 days or more

Have you debugged your code. Try looking out for the following and whether they are correct -

  1. Call compdate.AdjustDay(-5) and

  2. sF=“Form = ‘TestForm’ & Status = ‘Test’ & @Date(Updated) <= [” & compdate.DateOnly & “] & @IsUnavailable(Deleted) & @IsUnavailable($Conflict)”

Set coll = db.Search(sF, Nothing, 0) Set doc = coll.GetFirstDocument

Try running the agent manually with Debugger on.

–Phani