Use AppendDocLink in NotesRichTextItem But Document Link Not Appear in the Email

Dear All,

I have developed a workflow application with a function of sending email notification with document link. Upon user click on the submit action, the application should auto send out a email notification with document link.

The recipient managed to recieved the email notification but without document link.

I have been using the same function and code in my other workflow application databases, it work fine.And being debug the code using Notes debugger, it run through the Appenddoclink without any error. But don’t know why the email notification sent out without doc link.

Below are the function to send out email notification with doc link :

Sub MailSend( cSendTo As String, Subject As String, Content As Variant)

Dim newDoc As NotesDocument

Dim rtitem As NotesRichTextItem

Dim i As Integer

On Error Resume Next     



Set newDoc = New NotesDocument(WF_CurDb )

Set rtitem = New NotesRichTextItem(newDoc, "Body" )                    

newDoc.SendTo = cSendTo

newDoc.Subject = Subject



For i=0 To Ubound(Content)

Call rtitem.AppendText(Content(i))

Call rtitem.Addnewline(1)

Next

Call rtitem.AppendText(“Click on the doclink below to view problem details.”)

Call rtitem.Addnewline(1)

Call rtitem.AppendDocLink (WF_curdoc,“Click the doclink for detail.”)

Call newDoc.send(False)

End Sub

I hope anyone who face same problem before could share with me your solution to overcome this problem.

Thanks very much in advance.

Subject: Use AppendDocLink in NotesRichTextItem But Document Link Not Appear in the Email

I don’t see WF_curdoc being set - perhaps it’s a global variable. Has this document been saved in the database ? You cannot link to a new document until it’s been saved.

Subject: RE: Use AppendDocLink in NotesRichTextItem But Document Link Not Appear in the Email

Dear Graham,

I managed to found out cause of why the document link in email notification. This is due to I forgot to set a default view for the workflow application.

After I set a default view, now it works fine.

Thanks very much for your help.

Subject: RE: Use AppendDocLink in NotesRichTextItem But Document Link Not Appear in the Email

HI,

Thanks for your prmopt help. Yup the WF_curdoc being declare early. And confirm there is nothing worng with it. I do try to pass in the notes document but still having the same error.

The code and function I copy from my previous workflow applications. THose application till now still work fine with the AppendDocLink.

The Function to send notification I keep in Script Library. I called the Script Library in my form.

Beside this any other stuff I need to set ???

Please Help.