There are two situations:
- Your document and XPage are in the same database;
- Your Xpages are in a different database to your documents.
2. The ability to separate the code from the data is a strength of XPages. But it is then no longer possible to set the property on a document's form when the XPage is not in the same database. We need to send a link using mime, as you would have done in earlier versions of Notes. Here is the SSJS version:
var body = memo.createMIMEEntity();
var stream = session.createStream();
var info = <see below>;
body.setContentFromText(stream, "text/html; charset=iso-8859-1", 0);
In this case we simply want the email recipient to see a message about their role in the workflow, followed by a hotlink (Open Link) to open the appropriate document:
var info = msg + "<br /><br /><a href='"+applicationScope.serverURL + "/apps/code.nsf/xProposal.xsp?databaseName="+applicationScope.serverCN+"!!"+ applicationScope.dataDbName+"&documentId="+ doc.getUniversalID()+"&action=openDocument &content= docs_form'>Open Link</a>";
Application scope variables define the url of the server where the XPage is located and another to define the common name of the server where the database that contains the document is located. You can see that the link is to the XPage, xProposal.xsp, with the parameter, databaseName, defining the server and database, then the documentId parameter defining the document's universal id. The action parameter determines whether to open in read mode or edit mode.
You do need to apply Fixpack 2 to your 8.5.2 Domino servers if you wish to store your XPages in a datatbase that is in a different directory to the databases containing your documents and then be able to access this from the Notes client.