Doc Link Not Working in Scheduled Agent

I have an agent that sends an email with a doc link to a user. When I run the agent from the actions menu, the doc link works fine. When I put the agent on a schedule, the email works fine, but there is no doc link - only the words doc link. The preference for incoming mail in the NAB is “Keep in Senders’ Format”. Any help is greatly appreciated. Thanks.

Subject: Doc Link Not Working in Scheduled Agent

My guess here is that the mail is being sent to users’ name@whatever.com addresses, and that the doclinks are being converted to MIME format with high fidelity by a client (set to use MIME when addressing to internet addresses) and with low fidelity by the server’s outbound SMTP conversion. This may be happening before the address is recognised as internal. As long as the link doesn’t leave the environment when sent by the client, the link remains valid. The server cannot convert a link successfully all by itself (it would require a third-party tool such as COEXLinks – see Genii Software | CoexLinks ), so the text representation is all that’s sent. The best fix internally would be to make sure the mail is sent to Notes names rather than internet email addresses.

Subject: RE: Doc Link Not Working in Scheduled Agent

I tried using the Notes Names and I never received the email. I checked the server log and found the following messages:Begin CD to MIME Conversion

End CD to MIME Conversion

Router: Transferred 1 message to GHQPROD/MSHP400 via SMTP

Subject: RE: Doc Link Not Working in Scheduled Agent

The “via SMTP” part tells me that the actual addresses being used were not the Notes names – unless the people are not using Notes for mail, in which case the final destination is not a Notes mail address. If that’s the case, then you’d need to either create NDL file attachments, use Notes:// URLs, or use a third-party tool.

Subject: More Input!!

What are you using formula language or script? Please provide more info.

Subject: RE: More Input!!

Here is my code:

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim view As NotesView

Dim rtitem As NotesRichTextItem

Dim maildoc As NotesDocument

Dim maildb As New NotesDatabase "", "" )



Set db = session.CurrentDatabase

Set view = db.GetView("Contraband Timer")

Set doc = view.GetFirstDocument



Do Until doc Is Nothing

	If doc.Troop(0)="A" Then

		sendto="TroopBMail"

elseif doc.Troop(0) = “B” Then

sendto=“TroopBMail”

	End If

	

	doc.ContrabandFlag = "No"

	Call doc.Save(True, False)		

	doc.Form = "Memo"

	doc.SendTo = sendto

	doc.Subject = "Court Evidence Contraband due for Check In " + "Incident Number: " + Cstr(doc.Incidentnumber(0)) + " Container No: " + Cstr(doc.ContainerNo(0))

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

	Call rtitem.AppendText("The following Container Record is due for check. ---->  ")

	Call rtitem.AppendDocLink( doc, db.Title)

	Call doc.Send( False )

	Set doc=view.GetFirstDocument

Loop

End Sub

Subject: Not that it would make any difference, but…

If doc.Troop(0)=“A” Thensendto=“TroopBMail”

else

if doc.Troop(0) = “B” Then

sendto=“TroopBMail”

Both of the SendTo values are the same.

Are you saving the agent with the server’s id?

Does the server have a access to the doc?

Subject: RE: Not that it would make any difference, but…

There are actual email addresses in the sendto values. I replaced them with TroopBMail for posting purposes. Yes I am saving it with an id that we use to run agents that are on a schedule.

Subject: Hmmm…

Here’s the code I use and yours looks exactly like it???

memo.form=“Memo”

memo.SendTo = “Security”

memo.CopyTo = “Some User”

memo.Subject = “Security Notice " + " " + " -” + " " + “Delete Me” + “-” + key

Set rtitem = New NotesRichTextItem(memo, “Body”)

Call rtitem.AddNewLine(1)

Call rtitem.Appendtext("The following document is flagged for deletion. Click here to launch the document → ")

Call rtitem.AppendDocLink(doc1,“Title”)

Call memo.Send( False )

Puzzled???