I'm assuming you have to run the SSJS to get the url.
The following is a little kludgy but it's consistent and works.
The code uses ajax to call a domino agent or xagent that returns the url value and then prompts the user that they are being redirected.
without the alert it returns undefined everytime so there are some timing issues. I tried sleeping the process but that didn't fix it.
Will keep this in my "unrsolved" pile
working code
// Return the target node on the page where the results will be displayed
var targetNode = XSP.getElementById("#{id:displayResults}");
var db = "#{javascript:database.getFileName()}";
// The parameters to pass to xhrGet, the url, how to handle it, and the callbacks.
var turl;
var xhrArgs = {
url: "/" + db + "/DojoQueryXagent.xsp",
handleAs: "text",
load: function(data) {
turl = data;
targetNode.innerHTML = data;
},
error: function(error) {
targetNode.innerHTML = "An unexpected error occurred: " + error;
}
}
// Call the asynchronous xhrGet
var deferred = dojo.xhrGet(xhrArgs);
XSP.alert("You are being redirected to NetNotes")
window.open(turl, "_blank");