Problem on line 13 (what are the chances of that)
Error while executing JavaScript action expression
Script interpreter error, line=13, col=8: [TypeError] Method NotesRichTextItem.appendDocLink(NotesXspDocument) not found, or illegal parameters, when I comment out line 13 the rest of the code works fine, sends the email with the content from the document I am trying to pass to the email.

1 Answer
1

First of all make sure that your NSF has a default view setup. Doclinks won't work if there is no default view. You can tell if there is a default view by the presence of a gold star beside one of the views in designer.

From the error message it looks like your passing a NotesXspDocument into the appendDocLink method while it is expecting a NotesDocument. the first line of code should really be

var currDoc:NotesDocument = currentDocument.getDocument(true)

Also, has the document been saved at this point, if not then you should add a line

currDoc.save(true,true)

and this will make sure that the document is saved, You can't send a DocLink without the document UNID and an unsaved document will not have a valid UNID.