jkee54
asked on
Put doclink in new document - need help debugging
I have this code in the post save event of a document that I want to create a new form and have a link in it back to the original. It won't let me save, giving the error
"Postsave: 23: Not a member: APPENDDOCLINK"
on this line
Call rtitem.AppendDocLink(UIDoc ,"click to open")
I'm a script novice and copied/modified this code from another place where it works, but I must have modified something wrong.
Help!
"Postsave: 23: Not a member: APPENDDOCLINK"
on this line
Call rtitem.AppendDocLink(UIDoc
I'm a script novice and copied/modified this code from another place where it works, but I must have modified something wrong.
Help!
Dim ws As New NotesUIWorkspace
Dim session As New notesSession
Dim UIDoc As NotesUIDocument 'audit
Dim newdoc As NotesDocument 'mgr review
Dim db As NotesDatabase
Dim rtitem As NotesRichTextDocLink
Dim srce As NotesUIDocument
Set db = Session.CurrentDatabase
Set UIDoc = ws.CurrentDocument
Set newdoc= New NotesDocument(db)
Set rtitem = New NotesRichTextItem(newdoc,"auditlink")
Set srce = ws.CurrentDocument
Set curDoc = srce.Document
Set newdoc = db.CreateDocument
If (UIDoc.FieldGetText ("EScore") <96) Then
Call rtitem.AppendDocLink(UIDoc ,"click to open")
Call newdoc.ComputeWithForm(True, False)
Call newdoc.Save(True,False)
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I appreciate the coaching, especially the time you took to explain. I learn best by example, and/or modifying existing code, and your answer went a long way towards helping me. Thanks!
Add the following to your code:
dim doc as NotesDocument
after the code:
Set UIDoc = ws.CurrentDocument
add this code:
set doc = uidoc.Document
then your appenddoclink should look like this:
call rtitiem.AppendDoclink( doc, "click to open" )
hope this helps