ReplyTo Agent & $$Return

below is the script of my agent and it works okay, but when i change the subject according to what people filled in on web form, it failed. i change

doc.Subject=" Happy Holidays!"

to

doc.subject=doc.title

can anybody help?

  1. also, i use $$Return (value= url of another page) trying to display a page to viewer after they sent the web form, but it does not work (page not found),

can you help?


Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim view As NotesView

Dim doc As NotesDocument

Dim item As NotesItem

Dim ToWho As String

Dim FirstName As String

Dim Msg As String

Set db = session.CurrentDatabase

Set doc = New notesdocument(db) 



ToWho="me@hotmail.com"

FirstName="Joe"



doc.Principal = "me@hotmail.com@NotesDomain"

doc.Form = "Memo"



doc.Subject=" Happy Holidays!"

Greet = "Hi " +FirstName +", Happy Holidays!"

Msg1 ="additional text"

doc.Body=Greet + Msg1

Print toWho

Call doc.Send(True,toWho)

End Sub

Subject: ReplyTo Agent & $$Return

the agent will not be able to access the updations made to the form with doc until you set doc to ses.documentcontext.

to solve this you modify your coed as this

Dim session As New NotesSession

Dim db As NotesDatabase

Dim view As NotesView

Dim doc As NotesDocument

dim currdoc as notesdocument

Dim item As NotesItem

Dim ToWho As String

Dim FirstName As String

Dim Msg As String

Set db = session.CurrentDatabase

set currdoc=session.documentcontext

Set doc = New notesdocument(db) ToWho="me@hotmail.com"

FirstName=“Joe” doc.Principal = “me@hotmail.com@NotesDomain”

doc.Form = “Memo”

doc.Subject=currdoc.title(0)

Greet = “Hi " +FirstName +”, Happy Holidays!"

Msg1 =“additional text”

doc.Body=Greet + Msg1

Print toWho

Call doc.Send(True,toWho)

End Sub

Subject: RE: ReplyTo Agent & $$Return

thanks! it works now.i still got problem with $$return(page not found), any advise?