Create a link to a form

HI,I try to send a email to user who need to aprouve some task. this email must contains a link to a specific form.

The form contain a embedded view with categories (the username is the category).

I just need to create the link to the form.

here my code (where is my error?)

Function EmailRep(aqui As Variant)

Dim newDoc As NotesDocument

Dim db As NotesDatabase

Dim s As New NotesSession

Dim rtitem As NotesRichTextItem

Dim form As NotesForm



Set db = s.CurrentDatabase

Set newDoc = New NotesDocument( db )

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

Set form = db.GetForm("fViewRepresentant")



newDoc.Subject = "To be aproved"

newDoc.SendTo = aqui

newDoc.Form = "Memo"

Call rtitem.AppendDocLink(form,"Click here")	

End Function

Subject: create a link to a form

Hi,

We cannot give notes link to a Form in the mail through notes client.We can only give the link to the view or document

But can generate the link to the form through the url

“http;//Servername/dbname.nsf/formname?openform”

and send the same through mail.

Let me know if this helps

Subject: RE: create a link to a form

Or create a form in the database called Memo that includes a button to open the form you want, now set the sentTo etc. in that with an agent and send that instead of a regualr memo

Subject: IT’S WORK!

Thanks for your responds

I found another way…

1- Create a view categorised by username

2- Create a Form with Embeded view (1)

3- Here the Script:

Function EmailRep(aqui As Variant)

Dim newDoc As NotesDocument

Dim db As NotesDatabase

Dim s As New NotesSession

Dim rtitem As NotesRichTextItem

Dim view As NotesView

Dim docRep As NotesDocument

Dim form As NotesForm

Dim dc As NotesDocumentCollection

Set db = s.CurrentDatabase

Set newDoc = New NotesDocument( db )

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

Set view = db.GetView(“(ViewRepresentant)”)Set dc = view.GetAllDocumentsByKey(aqui, True)

' Impossible to create link to a form via email.

' I create a document (if the user doesn't have a document) and send link to email	

If dc.Count = 0 Then

' create document for user		Set docRep = New NotesDocument(db)

docRep.Form = "fViewRepresentant"

docRep.Cat = aqui

Call docRep.Save(True,True)

Else

Set docRep = dc.GetFirstDocument

End If

newDoc.Subject = “doc must be approuved”

newDoc.SendTo = aqui

newDoc.Form = “Memo”

Call rtitem.AppendDocLink(docRep,“Click here”)

Call newDoc.Send( False )

End Function

====================

So I create one document for each user (it’s a bad thing but better than nothing) who need to approved some task.

If it’s can help someone else…