Forum Discussion
DeanOusterhout
10 years agoQrew Assistant Captain
Nice Dan, I need a flavor of this... I need to fire some more javascript after we have the RID. I am not sure how to modify the sccobyDoo to do that? I tried placing a function call but it doesn't work... I am sure because I don't quite understand how you are making the new page appear? Can you help with how to get the next function to run?
Thanks, Dean
Here is what I tried...
(function(){
var querystring=document.location.search;
if (/nwr/i.test(querystring)) {
$("<iframe>", {id: "QBU_editform", name: "QBU_editform"})
.css({display: "none"})
.appendTo("body")
.on("load", function() {
QBbusyHide();
var rid = this.contentWindow.kRid;
var markup = "";
markup += "<h2>You just created a new record with [Record ID#] = " + rid + " !<h2>";
markup += "<center><img src='http://vignette3.wikia.nocookie.net/hanna-barbera/images/2/24/Scoobydoo.jpg' height='200'></center>";
$("<div>").html(markup).dialog({
title: "Save and Scooby Doo!",
modal: true,
close: function(event, ui) {
testAlert(rid);
document.location.href = gReqDBID + "?a=er&rid=" + rid;
}
});
});
$("form[name=editform]").prop({target: "QBU_editform"});
}
})();
function testAlert(rid) {
alert("in testAlert... so I can start and do whatever I need to now that I have the new record id of "+rid);
}
Thanks, Dean
Here is what I tried...
(function(){
var querystring=document.location.search;
if (/nwr/i.test(querystring)) {
$("<iframe>", {id: "QBU_editform", name: "QBU_editform"})
.css({display: "none"})
.appendTo("body")
.on("load", function() {
QBbusyHide();
var rid = this.contentWindow.kRid;
var markup = "";
markup += "<h2>You just created a new record with [Record ID#] = " + rid + " !<h2>";
markup += "<center><img src='http://vignette3.wikia.nocookie.net/hanna-barbera/images/2/24/Scoobydoo.jpg' height='200'></center>";
$("<div>").html(markup).dialog({
title: "Save and Scooby Doo!",
modal: true,
close: function(event, ui) {
testAlert(rid);
document.location.href = gReqDBID + "?a=er&rid=" + rid;
}
});
});
$("form[name=editform]").prop({target: "QBU_editform"});
}
})();
function testAlert(rid) {
alert("in testAlert... so I can start and do whatever I need to now that I have the new record id of "+rid);
}