[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 407
  • Last Modified:

Lotus Agent

HI:
I have help desk DB, i want to create one agent which sends email to Help desk personal notifying them of the pending cases assigned to them. can any one help.
Thanks
0
aib_it
Asked:
aib_it
  • 8
  • 2
  • 2
1 Solution
 
aib_itAuthor Commented:
Hi sysExpert;
Thank you very much for the post.
Can you please help me posting the following script into agent?
Like how to link the Help desk DB in the last lines?
Sub Initialize
      Dim session As New notessession
      Dim db As notesdatabase
      Dim view As notesview
      Dim doc As notesdocument
      Dim dc As notesdocumentcollection
      Dim TodayDateTime As notesdatetime
      Dim tmpdate As NotesDateTime
      Dim sec As Long
      Dim maildoc As notesdocument
      Dim Body As NotesRichTextItem
     
      Set tmpdate = New NotesDateTime( "" )
      Set db=session.currentdatabase
      Set view=db.getview("overview")
      Set TodayDateTime = New NotesDateTime( "Today" )
      currentdate=TodayDateTime.lsLocalTime
     
 'Messagebox( currentdate)
 'Msgbox Cdat(dateTime)
 'Check by a key with Interview
      Set dc=view.getalldocumentsbykey("Review",True)
      Set doc = dc.getfirstdocument
     
     
      While Not doc Is Nothing
 'Get values from columns
            tmpname=doc.review_x(0)
            tmpdate.lslocaltime=doc.deadline_d(0)
 'diffrence between two dates.
            sec = TodayDateTime.TimeDifference( tmpdate )
 'Msgbox sec
            balancedays=sec/86400
 'Msgbox balancedays
           
 'If the balance is more than one, send mail to interviewer.
            If (balancedays>1) Then
 'Msgbox "yes"
                  Set maildoc = New NotesDocument( db )
                  maildoc.Form = "Memo"
                  maildoc.Subject = _
                  "Reminder: Please Review New Application"
                  Set Body=New NotesRichTextItem(maildoc,"Body")
                  message="Please Review the New Application"
                  Call Body.AppendText(message)
                  Call Body.AddNewLine(2)
                  message1="Please Click here to open the Link=========>>"
                  Call Body.AppendText(message1)
                  Call Body.AppendDocLink(doc,"Please Click this Link to open the Document")
                  Call maildoc.Send( True, tmpname )
            End If
            Set doc=dc.getnextdocument(doc)
      Wend
     
End Sub
 
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Sjef BosmanGroupware ConsultantCommented:
Don't use maildoc.Send(True...) unless you really need to.

I can't really see a real problem with your code.
What's wrong with the code? Do you get any errors, in the log.nsf database?
0
 
aib_itAuthor Commented:
Thanks for thr reply.
Actually i wanted to know that how that once the new agent is created i have to put the code in the action section of the agent?
0
 
Sjef BosmanGroupware ConsultantCommented:
Ah, I see... The code isn't really yours...

In the Agents list, click New Agent; in the Properties window, enter a name for the agent, and at the bottom, set how you want the agent to run. If you start with the default settings, i.e. Action menu selection, set Target to None. Then in the Agent window, you have to change the Agent's type, from Simple action(s) to LotusScript. Then click on the Initialize-event at the left of the code-window.

You can replace the empty Initialize-event by the code you added above.
0
 
aib_itAuthor Commented:
Hi , I have created the agent,,, how this agent will understand to which email ID it has to send email. As this is help desk i need to identify only the support members.
Thanks
0
 
aib_itAuthor Commented:
HI Guys;
One more request , can any one give me  post DB open code where email should be sent to admin upon accessing the DB...
0
 
aib_itAuthor Commented:
Let this case be open for some time as i am currently doing some testings.
0
 
aib_itAuthor Commented:
Dear Moderator;
Let this case be opened till i finish my testings.
Thanks
0
 
aib_itAuthor Commented:
Dear Moderator;
Let this case be opened till i finish my testings.
Thanks
0
 
aib_itAuthor Commented:
Wasnt got the solution i was looking for.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 8
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now