Forum Discussion
QuickBaseCoachD
7 years agoQrew Captain
Hi Sharon (a.k.a. Ms. Quick Base Junky)
Great Tips, thx for posting.
I thought I would post one too. So Rich text fields work, so i wondered if I could get a HTML button or icon to work to edit a record and refresh the page without gong into edit mode on the card (record)
In my case I wanted to change the color bar to indicate my activity level on a project. By that I man I'm in a client meeting and we are juggling my priorities, and I may have several projects at the highest priority level, but for one reason or another I'm kinda in idle mode waiting on the users for information to proceed.
So, I decided that Green meant I was fully engaged, Yellow means just some light clean up, Blue mean sleeping - I'm waiting on others, etc. So I wanted a button to cycle the colors down, as I often start out gung ho in Green and then fall back to idle mode as the project gets turned over to the client for testing and feedback.
here is my formula HTML code
var text NextColour = Case([Activity Level Colour],
"", "green",
"green","yellow",
"yellow", "blue",
"blue","grey",
"grey","green");
var text red = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Project ID#]
& "&_fid_50=" & $NextColour;
var text Words = "<img src=https://images.quickbase.com/si/32/814-keyed_collection.png>";
var text URL = "javascript:" &
"$.get('" &
$red &
"',function(){" &
"location.reload(true);" &
"});";
"<a href=" & $URL & ">" & $Words & "</a>"
Great Tips, thx for posting.
I thought I would post one too. So Rich text fields work, so i wondered if I could get a HTML button or icon to work to edit a record and refresh the page without gong into edit mode on the card (record)
In my case I wanted to change the color bar to indicate my activity level on a project. By that I man I'm in a client meeting and we are juggling my priorities, and I may have several projects at the highest priority level, but for one reason or another I'm kinda in idle mode waiting on the users for information to proceed.
So, I decided that Green meant I was fully engaged, Yellow means just some light clean up, Blue mean sleeping - I'm waiting on others, etc. So I wanted a button to cycle the colors down, as I often start out gung ho in Green and then fall back to idle mode as the project gets turned over to the client for testing and feedback.
here is my formula HTML code
var text NextColour = Case([Activity Level Colour],
"", "green",
"green","yellow",
"yellow", "blue",
"blue","grey",
"grey","green");
var text red = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Project ID#]
& "&_fid_50=" & $NextColour;
var text Words = "<img src=https://images.quickbase.com/si/32/814-keyed_collection.png>";
var text URL = "javascript:" &
"$.get('" &
$red &
"',function(){" &
"location.reload(true);" &
"});";
"<a href=" & $URL & ">" & $Words & "</a>"
- JaimeStrawderma7 years agoQrew CadetVery cool. Thanks. This will work well with the task report I do.
- QuickBaseJunkie7 years ago
Qrew Legend
I like it! Thanks for sharing Mark - QuickBaseJunkie7 years ago
Qrew Legend
Taking a queue from your code, I applied it to the Status field, to cycle through various task statuses. Ended up needing to add a URLEncode due to spacing between words and QB seems to occasionally 'glitch' when I press the button (opens the record to edit)... but all in all a very cool effect!
var text NextStatus = Case([Status],
"", "Not Started",
"Not Started","In-Progress",
"In-Progress", "Issue",
"Issue","Completed",
"Completed","Canceled",
"Canceled","Not Started");
var text red = URLRoot() & "db/" & Dbid() & URLEncode("?act=API_EditRecord&rid=" & [Task ID]
& "&_fid_12=" & $NextStatus);
var text Words = "<img src=https://images.quickbase.com/si/32/814-keyed_collection.png>";
var text URL = "javascript:" &
"$.get('" &
$red &
"',function(){" &
"location.reload(true);" &
"});";
"<a href=" & $URL & ">" & $Words & "</a>" - QuickBaseCoachD7 years agoQrew CaptainYes I found that image had to be pretty big because if you click a bit off center it opens the record. I think my image was one size too small.
- JaimeStrawderma7 years agoQrew CadetI was successful in adding the three color options to my cards but all I get is a staggered view of red, yellow, green. What activates the change? How do I get the priority color to switch? Thanks.
- QuickBaseCoachD7 years agoQrew CaptainYou would need to create a Formula Rich text field like what I posted and then use that color field to set the color for the bar on the card.
var text NextStatus = Case([Status],
"", "Not Started",
"Not Started","In-Progress",
"In-Progress", "Issue",
"Issue","Completed",
"Completed","Canceled",
"Canceled","Not Started");
var text red = URLRoot() & "db/" & Dbid() & URLEncode("?act=API_EditRecord&rid=" & [Task ID]
& "&_fid_12=" & $NextStatus);
var text Words = "<img src=https://images.quickbase.com/si/32/814-keyed_collection.png>";
var text URL = "javascript:" &
"$.get('" &
$red &
"',function(){" &
"location.reload(true);" &
"});";
"<a href=" & $URL & ">" & $Words & "</a>"
I suggest disabling the need for Application Tokens in Advanced properties. - JaimeStrawderma7 years agoQrew CadetThank you. I had created the field and brought it over to my card but this is what it produces. Do you mean the the bar to the left will hold the color? Or these buttons are maneuverable? Thank you.
- QuickBaseCoachD7 years agoQrew CaptainIf you have made the formula similar to what I posed and use the option on the report builder to
Color-code cards using a formula
then the bars on the cards will color and will change color when you click the icon. The icon is probably a size too small.
This size might be better size "48"
https://images.quickbase.com/si/48/814-keyed_collection.png> - JaimeStrawderma7 years agoQrew CadetAwesome. Works great. thanks
- JaimeStrawderma7 years agoQrew CadetAnother question please...I have a column of "In Progress" tasks and a column for "Completed" tasks. On each card is a Date Completed: field. Can I get that field to populate with the current date when I move from "In Progress" to "Complete"? Thanks!