Hi,
I want to use the createReplyMessage for a document in XPages, but there are now examples in the help file , and hard to figure out how to use. Maybe someone can help me with any hints or code example. This is as far as I’ve got:
Behind my Reply-link I’m setting a couple of sessionScope variables to hold the UNID for the current document with these to JavaScript lines:
sessionScope.currentAction = “Reply”
sessionScope.replyToDocUniversalID = currentDocument.getDocument().getUniversalID();
The link then opens the XPage containing the custom control with a new document. My goal now is to get the document I just closed, use the createReplyMessage method on it, and open the resulting document as source. It is important to avoid saving the document in case the user press cancel or exits the browser.
I have tried this code in beforePageLoad:
if (sessionScope.containsKey(“currentAction”)){
if (sessionScope.get("currentAction").equals("Reply")){
var thisDatabase = session.getCurrentDatabase();
replyToDoc:NotesDocument = thisDatabase.getDocumentByUNID(sessionScope.get("replyToDocUniversalID"));
var newDoc:NotesDocment = replyToDoc.createReplyMessage(true);
}
}
It gives no errors, but I don’t know how to get the newDoc as source for the XPage. I have also tried the same snippet in queryNewDocument, but I have of course the same problem there. I’m using the memoDoc as variable name for the source document in the custom control, an have tried to use that variable name instead of newDoc, but it didn’t work.
Any suggestions are welcome