Hi!
In a discussion db which i got from the Lotus Notes 8.5 template, I have modified the postSaveDocument event to be able to send an email after a post is saved.
This works fine until I attach a file to the page.
I get this Unexpected runtime error:
"Error while saving data sources
Error saving data source dominoDoc
Could not save the document NEW_a NotesException: Disk i/o is a restricted operation"
Below is the code I placed in the event:
db = session.getDatabase(“server”,“db”)
doc = db.createDocument()
poster = @Text(dominoDoc.getItemValueString(‘From’))
subj = @Text(dominoDoc.getItemValueString(‘Subject’))
emailAdd = @Text(dominoDoc.getItemValueString(‘SendToEmail’))
var aName = session.createName(dominoDoc.getItemValueString(“From”));
doc.appendItemValue(“Form”,“Memo”)
doc.replaceItemValue(“Principal”,“Discussion Db”)
doc.replaceItemValue(“InetFrom”,“Discussion Db”)
doc.replaceItemValue(“From”,“Discussion Db”)
doc.replaceItemValue(“DisplayFrom”,“Discussion Db”)
doc.replaceItemValue(“DisplayFrom_Preview”,“Discussion Db”)
doc.replaceItemValue(“DisplaySent”,“Discussion Db”)
doc.replaceItemValue(“Subject”,"Topic Post " + subj)
doc.replaceItemValue(“SendTo”,emailAdd) //doc.listSendTo(0
doc.replaceItemValue(“CopyTo”, “abc@abc.org”)
url=“http://server.abc.org/topicThread.xsp?action=openDocument&documentId=”+dominoDoc.getNoteID();
txt = “
”
txt = txt + "A post has been created by " + aName.getCommon() + “for your info.” + “
”
txt = txt + “Click here to view the post.” + “
”
txt = txt + “Thank you.
”
txt = txt + “(This is a computer-generated message.)
”
body = doc.createMIMEEntity()
stream = session.createStream()
stream.writeText(txt)
body.setContentFromText(stream, “text/html; charset=iso-8859-1”, 0)
doc.send()
…would truly appreciate the help.
Thanks!
Tine