Forum Discussion
ChrisFaye1
6 years agoQrew Cadet
Thank You, Mark! As always you're amazing!
So would I'd be adding it into the formula button, right?
Here's the current formula. Sorry I'm a little turned around on where to splice in the If statement.
// edit the record: fid 109 to [Approved By] - Stamp application with approver name and date/time
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_236=" & URLEncode(UserToName(User()))
& "&_fid_237=true"
& "&apptoken=.....";
//Display Current Record
var text DisplayRecord=
URLRoot() & "db/" & Dbid()
& "?a=dr&rid=" & [Record ID#]
& "&apptoken=.....";
//String, Edit and Display Current Original Record
$URLONE
& "&rdr=" & URLEncode($DisplayRecord)
------------------------------
Chris
------------------------------
So would I'd be adding it into the formula button, right?
Here's the current formula. Sorry I'm a little turned around on where to splice in the If statement.
// edit the record: fid 109 to [Approved By] - Stamp application with approver name and date/time
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_236=" & URLEncode(UserToName(User()))
& "&_fid_237=true"
& "&apptoken=.....";
//Display Current Record
var text DisplayRecord=
URLRoot() & "db/" & Dbid()
& "?a=dr&rid=" & [Record ID#]
& "&apptoken=.....";
//String, Edit and Display Current Original Record
$URLONE
& "&rdr=" & URLEncode($DisplayRecord)
------------------------------
Chris
------------------------------
MarkShnier__You
Qrew Legend
6 years agoOK, it is helpful to see your code
Try this
// edit the record: fid 109 to [Approved By] - Stamp application with approver name and date/time
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_236=" & URLEncode(UserToName(User()))
& "&_fid_237=true"
& "&apptoken=.....";
var text URL =
"javascript:" &
"$.get('" &
$URLONE &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);";
If([checkbox]=true,
"<a class='Vibrant Danger'>Approved</a>",
"<a class='Vibrant Success' style='border:1px solid #6BBD57; background-color:#6BBD57'" & "a href=" & $URL & ">Click to Approve</a>")
You can also substitute 'Vibrant Primary' for 'Vibrant Danger' if you want the button to be blue instead of red when approved. Or 'Vibrant Alert" for a yellow color.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
Try this
// edit the record: fid 109 to [Approved By] - Stamp application with approver name and date/time
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_236=" & URLEncode(UserToName(User()))
& "&_fid_237=true"
& "&apptoken=.....";
var text URL =
"javascript:" &
"$.get('" &
$URLONE &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);";
If([checkbox]=true,
"<a class='Vibrant Danger'>Approved</a>",
"<a class='Vibrant Success' style='border:1px solid #6BBD57; background-color:#6BBD57'" & "a href=" & $URL & ">Click to Approve</a>")
You can also substitute 'Vibrant Primary' for 'Vibrant Danger' if you want the button to be blue instead of red when approved. Or 'Vibrant Alert" for a yellow color.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- ChrisFaye16 years agoQrew CadetThank You, Mark!
I just plugged it in and the button itself isn't responding to the formatting. Could it be something to do with the field display settings? I'm playing around with them, but not finding anything that works. (Getting no button/only link or the button with the field settings color, etc.)
Here's a screenshot of the field settings.
------------------------------
Chris
------------------------------- MarkShnier__You6 years ago
Qrew Legend
The field type will need to be Formula Rich Text and not Formula URL, if you want to control the button appearance.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------- ChrisFaye16 years agoQrew Cadet<palm in face>...
Thanks for catching my errors... always.
In your opinion - other than to avoid coding the button appearance, is there ever a reason to go Formula - URL vs. Formula - Rich Text?
------------------------------
Chris
------------------------------