Forum Discussion
JENNIFERPASCHAL
4 years agoQrew Trainee
There a checkboxes hooked on in the URL statement that get checked when the button is clicked.
The button only needs to change color and can remain clickable.
------------------------------
Thanks in advance,
Jennifer Paschal
------------------------------
The button only needs to change color and can remain clickable.
------------------------------
Thanks in advance,
Jennifer Paschal
------------------------------
MarkShnier__You
Qrew Legend
4 years agoYou cannot change the color of a URL formula URL button, but if you make a Formula Rich Text button then you can control the color. There is more than one way to do it, but I think that this is the most simple code to color a button.
The formula includes as comment lines all the all the possible colors for the buttons when using the "Vibrant' syntax shortcut
var text Words = "Click here to Toggle";
var text Checkbox = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_12=" & not [checkbox];
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
var text URL =
$Checkbox
& "&rdr=" & URLEncode($RefreshPage);
If([checkbox]=false,
"<a class=\"Vibrant Primary\"a href=" & $URL & ">" & $Words & "</a>", // blue
"<a class=\"Vibrant \"a href=" & $URL & ">" & $Words & "</a>") // gray
// "<a class='Vibrant'>Vibrant</a>", // regular grey button
// "<a class='Vibrant Alert'>Vibrant Alert</a>", // yellowish
// "<a class='Vibrant Danger'>Vibrant Danger</a>", // red
// "<a class='Vibrant Primary'>Vibrant Primary</a>", // blue
// "<a class='Vibrant Snowy'>Vibrant Snowy</a>", // white
// "<a class='Vibrant Success'>Vibrant Success</a>" // green
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
The formula includes as comment lines all the all the possible colors for the buttons when using the "Vibrant' syntax shortcut
var text Words = "Click here to Toggle";
var text Checkbox = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_12=" & not [checkbox];
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
var text URL =
$Checkbox
& "&rdr=" & URLEncode($RefreshPage);
If([checkbox]=false,
"<a class=\"Vibrant Primary\"a href=" & $URL & ">" & $Words & "</a>", // blue
"<a class=\"Vibrant \"a href=" & $URL & ">" & $Words & "</a>") // gray
// "<a class='Vibrant'>Vibrant</a>", // regular grey button
// "<a class='Vibrant Alert'>Vibrant Alert</a>", // yellowish
// "<a class='Vibrant Danger'>Vibrant Danger</a>", // red
// "<a class='Vibrant Primary'>Vibrant Primary</a>", // blue
// "<a class='Vibrant Snowy'>Vibrant Snowy</a>", // white
// "<a class='Vibrant Success'>Vibrant Success</a>" // green
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- JENNIFERPASCHAL4 years agoQrew TraineeOkay, thank you so much, here is a follow up question. This is needed for several buttons that are already in use and used for several triggers and workflow elements. Is possible to simply change the field type on these to the Formula Rich Text type so that less rework needs to be done?
------------------------------
Thanks in advance,
Jennifer Paschal
------------------------------- MarkShnier__You4 years ago
Qrew Legend
Yes, you can change the field type to Formula Rich text and adjust the code.
As you probably figured out yourself for the very first button you should copy the field until you get it working but if you have a bunch of other similar buttons to change over and you are now confident in how to make them work then sure you can just change the field type to formula rich text and the button would only be broken for the five minutes or so that it would take you to adjust the code.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------