Forum Discussion
DavidBerndt
8 years agoQrew Cadet
Ok - found it - thanks to ideas from Kirk Trachy(Magic Button) and Mark Shnier, Your QuickBase CoachQuickBaseCoach
Basically you can via the JavaScript open a new window with the mailto info and then close it. Unfortunately it needs either a sleep function (seen here) or a monitor loop because if you run the close right away the mailto may not get executed.
So this code:
1) Updates the record to a "Completed" status
2) Opens a window to generate a mailto call
3) Waits for the window to be open
4) Closes the blank window remaining from the mailtto
5) Open/returns to the dashboard in the initial tab/window
--------------------
var text url=
URLRoot()& "db/" &Dbid()& "?a=API_EditRecord" &
"&rid=" & [Call ID#]&
"&apptoken=d9eascudwjxs2sesxkjccwgtq9r"&
"&_fid_86=Completed";
var text urlDash=
URLRoot() & "db/" & Dbid();
"javascript:" &
"$.get('" &
$url &
"'," &
"function() {" &
" win = window.open('mailto:name@comp.com');" &
"var start = new Date().getTime(); for (var i = 0; i < 1e7; i++) { if ((new Date().getTime() - start) > milliseconds){ break; } } }"
" win.close();}" &
");" &
"void(0);
Basically you can via the JavaScript open a new window with the mailto info and then close it. Unfortunately it needs either a sleep function (seen here) or a monitor loop because if you run the close right away the mailto may not get executed.
So this code:
1) Updates the record to a "Completed" status
2) Opens a window to generate a mailto call
3) Waits for the window to be open
4) Closes the blank window remaining from the mailtto
5) Open/returns to the dashboard in the initial tab/window
--------------------
var text url=
URLRoot()& "db/" &Dbid()& "?a=API_EditRecord" &
"&rid=" & [Call ID#]&
"&apptoken=d9eascudwjxs2sesxkjccwgtq9r"&
"&_fid_86=Completed";
var text urlDash=
URLRoot() & "db/" & Dbid();
"javascript:" &
"$.get('" &
$url &
"'," &
"function() {" &
" win = window.open('mailto:name@comp.com');" &
"var start = new Date().getTime(); for (var i = 0; i < 1e7; i++) { if ((new Date().getTime() - start) > milliseconds){ break; } } }"
" win.close();}" &
");" &
"void(0);