Reminder Agent

How to send a reminder email thru schedule agent to managers
if records has outstanding for more then 2 days.
jiayilooAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bengaleCommented:
Two possibilities :

1 - Create an agent scanning the DB documents, searching by field the "last modification date" field, date before the last two days. (this field exists by default in documents)

2 - Create a "workflow history" field that records the last modification date

Then make the agent searching in this field, date before the last two days
0
jiayilooAuthor Commented:
I have a Date_Create field that capture the document creation date. Can you give some sample of agent formula/script program that can do verification on the date whether it is 2 days old or more.

Pls elaborate on possibility 2.

Which way is easier / better.

Thks in advance.
0
jiayilooAuthor Commented:
Need sample agent code
0
6924Commented:
You might try the following script. in a scheduled agent .  I used "on schedule daily" against "All documents in database"

1.  You will need to change the Const Mgr value to the name of the manager whom you want to send a notification to.  
2.  I am looking at a field called ChgStatus - and sending this notification only if the status has not changed in 2 days since creation.  You may not want this criteria at all - if not, you can delete that part of the query
3.  You need to change the form name on the line "Set collection=dbSearch....  to be the name of the form you are working with
4.  Change the text of the memo as you wish.

Hope this helps.

Sub Initialize
    Const Mgr = "Enter the name to be mailed to here"
     Dim Session As New NotesSession
     Dim db As NotesDatabase
     Dim collection As NotesDocumentCollection
     Dim dt As New NotesDateTime("1/1/99")
     Dim newdoc As NotesDocument
     Dim view As NotesView
     Dim reviewerdoc As NotesDocument
     Dim reviewer As String
     Dim rtitem As NotesRichTextItem
     Dim linkdoc As NotesDocument
     Dim linksummary As String
     
     Set db=session.CurrentDatabase
'MODIFY THE FOLLOWING LINE WITH THE PARAMETERS FOR THE DOCUMENTS THAT MEET YOUR CRITERIA
     Set collection = db.Search("Form = ""Computer System Request Form"" & ChgStatus = ""New"" & @Adjust(@Today;0;0;-2;0;0;0) > @Modified", dt, 0)    
     If collection.count = 0 Then
          Exit Sub
     End If
     Set newdoc = New NotesDocument(db)
     newdoc.Form = "Memo"
 

     newdoc.SendTo = Mgr
     newdoc.Subject = "Document outstanding for more than 2 days"
     Set rtitem = New NotesRichTextItem(newdoc,"Body")
     Call rtitem.AppendText("The following linked documents were created more than 2 days ago and require your attention!")
     Call rtitem.AddNewLine(2)
     For x = 1 To collection.count
          Set linkdoc = collection.GetNthDocument(x)
          linksummary = linkdoc.ChgSummary(0)
          Call rtitem.AppendDocLink(linkdoc,"")
          Call rtitem.AddTab(1)
          Call rtitem.AppendText(linksummary)
          Call rtitem.AddNewLine(1)
     Next
     Call newdoc.Send(False)
     
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jiayilooAuthor Commented:
Excellent Thks...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.