Forum Discussion
ChrisFaye1
6 years agoQrew Cadet
Thank You so much, Mark!
I did look through Kirk's Magic Buttons app and stumbled a bit. Downloaded yours and the explanation got me moving! Also, thank you for throwing everything into the post as well!
2 questions if you have time
- Is there any way to code in larger pop-ups or a directory I could look to? I'm thinking about either making the pop-up bigger or centering it on the page.
- Is there a correct way of combining the refresh with the pop-up?
Here's what I've got that seems to be functioning except for trying to get the pop-up to display following the refresh. I tried a few ways with no luck and here's what I ended up with.
// edit the record
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_19=" & URLEncode(UserToName(User()))
& "&apptoken=...";
// Add record in 'Duplicate Test' Table & copy fid 6 to [Name]
var text AddRecord =URLRoot() & "db/" & [_DBID_DUPLICATE_TEST]
& "?act=API_AddRecord"
& "&apptoken=..."
& "&_fid_6=" & [Name];
//Refresh, Display Current Original Record and Display Green pop-up for 15 seconds
var text DisplayRecord=
URLRoot() & "db/" & Dbid()
& "?a=dr&rid=" & [Record ID#]
& "&apptoken=..."
&
"javascript:" &
"$.get('" &
$URLONE &
"',function(){" &
"$.jGrowl('This File has been Approved For Invoicing', {life: 15000, theme: 'jGrowl-green'});" &
"});" &
"void(0);";
$URLONE
& "&rdr=" & URLEncode($AddRecord)
& URLEncode("&rdr=" & URLEncode($DisplayRecord))
Thanks Again!
------------------------------
Chris
------------------------------
I did look through Kirk's Magic Buttons app and stumbled a bit. Downloaded yours and the explanation got me moving! Also, thank you for throwing everything into the post as well!
2 questions if you have time
- Is there any way to code in larger pop-ups or a directory I could look to? I'm thinking about either making the pop-up bigger or centering it on the page.
- Is there a correct way of combining the refresh with the pop-up?
Here's what I've got that seems to be functioning except for trying to get the pop-up to display following the refresh. I tried a few ways with no luck and here's what I ended up with.
// edit the record
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_19=" & URLEncode(UserToName(User()))
& "&apptoken=...";
// Add record in 'Duplicate Test' Table & copy fid 6 to [Name]
var text AddRecord =URLRoot() & "db/" & [_DBID_DUPLICATE_TEST]
& "?act=API_AddRecord"
& "&apptoken=..."
& "&_fid_6=" & [Name];
//Refresh, Display Current Original Record and Display Green pop-up for 15 seconds
var text DisplayRecord=
URLRoot() & "db/" & Dbid()
& "?a=dr&rid=" & [Record ID#]
& "&apptoken=..."
&
"javascript:" &
"$.get('" &
$URLONE &
"',function(){" &
"$.jGrowl('This File has been Approved For Invoicing', {life: 15000, theme: 'jGrowl-green'});" &
"});" &
"void(0);";
$URLONE
& "&rdr=" & URLEncode($AddRecord)
& URLEncode("&rdr=" & URLEncode($DisplayRecord))
Thanks Again!
------------------------------
Chris
------------------------------
ChrisFaye1
6 years agoQrew Cadet
Think I found some info on the jGrowl options, but if you have any thoughts I'm all ears.
Regarding the formula, I also tried it this way with no success -
// edit the record
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_19=" & URLEncode(UserToName(User()))
& "&apptoken=da5rkk4b9jnqzmdbatsp2bffnnum";
// Add record in 'Duplicate Test' Table & copy fid 6 to [Name]
var text AddRecord =URLRoot() & "db/" & [_DBID_DUPLICATE_TEST]
& "?act=API_AddRecord"
& "&apptoken=da5rkk4b9jnqzmdbatsp2bffnnum"
& "&_fid_6=" & [Name];
//Refresh, Display Current Original Record
var text DisplayRecord=
URLRoot() & "db/" & Dbid()
& "?a=dr&rid=" & [Record ID#]
& "&apptoken=da5rkk4b9jnqzmdbatsp2bffnnum";
//Display Green pop-up for 15 seconds
var text URL =
"javascript:" &
"$.get('" &
$URLONE &
"',function(){" &
"$.jGrowl('This File has been Approved For Invoicing', {life: 15000, theme: 'jGrowl-green'});" &
"});" &
"void(0);";
//String
$URLONE
& "&rdr=" & URLEncode($AddRecord)
& URLEncode("&rdr=" & URLEncode($DisplayRecord))
& URLEncode (URLEncode("&rdr=" & URLEncode($URL)))
------------------------------
Chris
------------------------------
Regarding the formula, I also tried it this way with no success -
// edit the record
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_19=" & URLEncode(UserToName(User()))
& "&apptoken=da5rkk4b9jnqzmdbatsp2bffnnum";
// Add record in 'Duplicate Test' Table & copy fid 6 to [Name]
var text AddRecord =URLRoot() & "db/" & [_DBID_DUPLICATE_TEST]
& "?act=API_AddRecord"
& "&apptoken=da5rkk4b9jnqzmdbatsp2bffnnum"
& "&_fid_6=" & [Name];
//Refresh, Display Current Original Record
var text DisplayRecord=
URLRoot() & "db/" & Dbid()
& "?a=dr&rid=" & [Record ID#]
& "&apptoken=da5rkk4b9jnqzmdbatsp2bffnnum";
//Display Green pop-up for 15 seconds
var text URL =
"javascript:" &
"$.get('" &
$URLONE &
"',function(){" &
"$.jGrowl('This File has been Approved For Invoicing', {life: 15000, theme: 'jGrowl-green'});" &
"});" &
"void(0);";
//String
$URLONE
& "&rdr=" & URLEncode($AddRecord)
& URLEncode("&rdr=" & URLEncode($DisplayRecord))
& URLEncode (URLEncode("&rdr=" & URLEncode($URL)))
------------------------------
Chris
------------------------------
- MarkShnier__You6 years ago
Qrew Legend
First of all, it does not make sense to both try to refresh the page with the javascript and also have a triple redirect where the last step is to redisplay the record. So if you want to try to do the first two steps as the URL, then try that.
Also I assume that the definition of the formula variable for URLONE needs to be before it is used, but maybe it does not. Just seems strange to me to have it below the javascript.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
markshnier2@gmail.com
------------------------------- ChrisFaye16 years agoQrew CadetThank You as always, Mark! I was just getting greedy once I saw the potential :)
------------------------------
Chris
------------------------------