HankHalverson
4 years agoQrew Cadet
Save and Print a Form
Hello,
I am making a button that will go on a form that will save the data then bring up the print menu. The issue I am running into is that if I add a button that simply says print this record it doesn't work because it is a form and hasn't been saved into a record yet. So I need a button that will save then print. The next thing I tried was to save by redirecting then trying to print but I cannot get that to work because the URL code calls the active RID which is gone once the page has redirected. I am not completely confident in my button/url coding abilities so I could be fundamentally wrong about what is going on but I would appreciate any help to point me in the right direction.
My code for a formula URL that tries to just print the form:
URLRoot() & "db/" & Dbid() & "?a=printr&dfid=11&rid=" & [Record ID#]
//I don't think the RID exists until the form is saved
Then my code to redirect the user to save the form to a record:
//formatting visuals of button
var text bgcolor = "#34A853";
var text txtcolor = "white";
var text style = "style=\"text-decoration: none; background:" & $bgcolor & "; border-radius: 5px; padding: 8px 20px; color: " & $txtcolor & "; display: inline-block; font: normal 700 24px/1 \"Calibri\", sans-serif; text-align: center; text-shadow: none;";
//Inner workings of button
var text url =
URLRoot() & "db/" & [_DBID_Project] & "?a=printr&dfid=11&rid=" &[Record ID#]
& "&apptoken=uwi4fb9cj4szcdzjnfxd5xz3te"
& "&rdr=" & URLEncode("https://divisionsinc.quickbase.com/db/brjciz2i6?a=td");
"<a " & $style & " href=\"" & $url & "\">Save and Print</a>"
I couldn't get either of these to work so any help is appreciated. Thanks in Advance!
------------------------------
Hank Halverson
------------------------------
I am making a button that will go on a form that will save the data then bring up the print menu. The issue I am running into is that if I add a button that simply says print this record it doesn't work because it is a form and hasn't been saved into a record yet. So I need a button that will save then print. The next thing I tried was to save by redirecting then trying to print but I cannot get that to work because the URL code calls the active RID which is gone once the page has redirected. I am not completely confident in my button/url coding abilities so I could be fundamentally wrong about what is going on but I would appreciate any help to point me in the right direction.
My code for a formula URL that tries to just print the form:
URLRoot() & "db/" & Dbid() & "?a=printr&dfid=11&rid=" & [Record ID#]
//I don't think the RID exists until the form is saved
Then my code to redirect the user to save the form to a record:
//formatting visuals of button
var text bgcolor = "#34A853";
var text txtcolor = "white";
var text style = "style=\"text-decoration: none; background:" & $bgcolor & "; border-radius: 5px; padding: 8px 20px; color: " & $txtcolor & "; display: inline-block; font: normal 700 24px/1 \"Calibri\", sans-serif; text-align: center; text-shadow: none;";
//Inner workings of button
var text url =
URLRoot() & "db/" & [_DBID_Project] & "?a=printr&dfid=11&rid=" &[Record ID#]
& "&apptoken=uwi4fb9cj4szcdzjnfxd5xz3te"
& "&rdr=" & URLEncode("https://divisionsinc.quickbase.com/db/brjciz2i6?a=td");
"<a " & $style & " href=\"" & $url & "\">Save and Print</a>"
I couldn't get either of these to work so any help is appreciated. Thanks in Advance!
------------------------------
Hank Halverson
------------------------------