Q
Problem solve Get help with specific problems with your technologies, process and projects.

Problem sending attachments with reminder script

I have encountered a problem when sending mail with attachments. I have written the Script for an agent to send a reminder (Through mail) to user if the Purchase Request is not approved by him. In the reminder, I need to attach a document link, but the document link icon does not show in the mail. My Script is below--can you please help me to check where the error comes from?

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim doc, doc1 As NotesDocument
  Dim rtitem As NotesRichTextItem
  Dim view As Notesview
  Dim status, prdate As String
  Set db = session.CurrentDatabase
  Set view = db.getview("Purchase Request By Ref No.")
  Set doc1 = view.GetFirstDocument
  Set doc = New NotesDocument( db )
  Set rtitem = New NotesRichTextItem( doc, "Body" )
  Do While Not doc1 Is Nothing
    status=doc1.PR_status1(0)
    prdate=doc1.PR_requestdate(0)
    If status="Pending" Then
        If Datevalue(prdate) < Now Then
           doc.Form = "Memo"
           doc.SendTo = "Tan"                      doc.Subject = "PR 
Approval Reminder !"
           doc.Body = "There is a PR that needs your immediate approval  "
           Call rtitem.AppendDocLink(doc, "")
           Call doc.Send(True)
        End If
    End If
    Set doc1 = view.GetNextDocument(doc1)
  Loop

End Sub

I think your problem is a simple one. When you append the doclink, you are attempting to append a link to the document you are creating (doc). Since this has not been saved, there is no document id to include. I think you really wish to send the link to the Purchase Request document. Try this code just above the send:

Call rtitem.AppendDocLink(doc1, "Purchase Request")


This was last published in August 2001

Dig Deeper on Lotus Notes Domino Administration Tools

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close