I just want to get this script out of my editor so here goes. This essential script when invoked from a button click will open a new window specified by the variable
urlNew and monitor changes to that second window's URL. So when a user submits the form on that second window or navigates away from the original URL of the second window, the script running in the first window will close the second window automatically.
var urlNew = "https://<SUBDOMAIN>.quickbase.com/db/<DBID>?a=nwr";
var mywin = window.open(urlNew);
var monitor = setInterval(function() {
console.log(mywin.location.href) ;
if (mywin.location.href != urlNew) {
mywin.close();
clearInterval(monitor);
}
}, 1000);
This is sort of an old-school navigational scheme that has fallen out of favor but may still be useful when you have a longish form to fill out and a dialog box in the first window would be to small.
Pastie Databasehttps://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=629