Forum Discussion
- QuickBaseCoachDQrew CaptainThis format will work on a record or a report.
var text URL = URLRoot() & "db/" & "?act=API_EditRecord&_fid_80=1&rid=" & [Record ID#];
"javascript:" &
"$.get('" &
$url &
"',function(){" &
"$.jGrowl('This Item has been put on PO CANCEL snooze', {life: 5000, theme: 'jGrowl-green'});" &
"});" &
"void(0);"
The 5000 means it will display the pop up for 5 seconds before it fades away on its own.
I have never tried this on a dashboard in part because the button needs to know which record to act on.- CarlosCarlosQrew Assistant CaptainJust what I needed!! FYI, it works like a charm in reports as well!!
BIG THANKS! - CarlosCarlosQrew Assistant CaptainIs there a way to implement this from a Formula-Text button, instead of a Formula-URL ??
Thanks - QuickBaseCoachDQrew CaptainIt took me a while to get this working as there were some recent posts from Laura Hillier and Matthew Neil which i needed to cobble together. But now i have it for myself too. There is some crazy syntax for sure.
This worked
var text Update= URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_188=" & ToText(Now());
var text URL =
"javascript:" &
"$.get('" &
$Update &
"',function(){" &
"$.jGrowl('This Item has been put on PO CANCEL snooze', {life: 5000, theme: 'jGrowl-green'});" &
"});" &
"void(0);";
"<a class='Vibrant Danger' href=\"" & $URL &"\"" & ">Button name goes here" & "</a>"
The choices for the button color are:
"<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
)
- ChrisChrisQrew Assistant Captain
Carlos,
Did you do anything differently to the code to make the buttons work in your reports? I applied the apptoken parameter to the query string and the buttons work with apptokens enabled, but in a report the buttons do not work.
Chris
- CarlosCarlosQrew Assistant CaptainChris, no nothing different.
Here's the code to one of the buttons I did:var text action = URLRoot() & "db/" & Dbid() & "?a=API_editRecord&key="& [Item] & "&_fid_699=1" & "&_fid_700=" & URLEncode(User()) & apptoken=abcdefg1234567;
var text url = "javascript:" & "$.get('" & $action & "',function(){" & "$.jGrowl('Growl notification text goes here', {life: 5000, theme: 'jGrowl-green'});" &"});" &"void(0);";
var text button = "<a class='Vibrant Alert' href=\"" & $url &"\"" & "> Do action and Growl " & "</a>";
$button
- QuickBaseCoachDQrew CaptainThe buttons should work identically on a report or form.
- CarlosCarlosQrew Assistant CaptainAre you aware of any changes to this? after this weekend's update this no longer seems to be working from reports or records
- QuickBaseCoachDQrew CaptainIt's working for me.
This is working, for example.
var text Update= URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_188=" & ToText(Now());
var text URL =
"javascript:" &
"$.get('" &
$Update &
"',function(){" &
"$.jGrowl('This Item has been put on PO CANCEL snooze', {life: 5000, theme: 'jGrowl-green'});" &
"});" &
"void(0);";
"<a class='Vibrant Danger' href=\"" & $URL &"\"" & ">Button name goes here" & "</a>
- StephenStephenQrew Assistant CaptainI modified and used in my report but pressing the button shows no reaction.
my fid is 10 and it's a checkbox. I simply want to be able to press the button in a report to mark the checkbox checked because I don't want to have to use "grid edit" which would render another button I have (to open at the URL of the record in a new window) useless.var text Update= URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_10=1";
var text URL = "javascript:" &"$.get('" & $Update & "',function(){" &"$.jGrowl(�Item Marked Completed�, {life: 5000, theme: 'jGrowl-green'});" &"});" &
"void(0);";
"<a class='Vibrant Danger' href=\"" & $URL &"\"" & ">Mark Completed" & "</a>" - QuickBaseCoachDQrew CaptainTo test this, I suggest that you make a temporary formula URL field with just this.
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_10=1"
My guess is that when you click that it will fail on something, likely a complaint about the application token is missing.
I suggest that you then go to the settings for the App and then Advanced settings and either disable the need for Application Tokens or else create one and include the extra line
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_10=1"
& "&apptoken=xxxxxxxxxxxx - StephenStephenQrew Assistant CaptainThanks Coach. The Formula URL button did show it needed an app token, and now the test button works fine (although it shows the XML result and doesn't finish the button, refresh and return to the same report screen).
So while that line was fixed, the next two don't work either. When I click the button nothing happens, so there clearly are issues with the next two lines of code.
Perhaps I need to load the jGrowl first? I don't see that in this thread but I've toyed with other people's code (like the tabbed forms) and used an "onload" field to load the javascript..I"m a newbie and can't really code in javascript, I can just tweak simple stuff from other people sometimes. - QuickBaseCoachDQrew CaptainI know that this will work, but the button will be grey. I'm not sure that I have working code to easily post to get the jgrowl to work as a Vibrant colored button.
var text URL = URLRoot() & "db/" & "?act=API_EditRecord&_fid_80=1&rid=" & [Record ID#];
"javascript:" &
"$.get('" &
$url &
"',function(){" &
"$.jGrowl('This Item has been put on PO CANCEL snooze', {life: 5000, theme: 'jGrowl-green'});" &
"});" &
"void(0); - QuickBaseCoachDQrew CaptainCan you post your current code that is not working?
- StephenStephenQrew Assistant CaptainThis is what I had before your last post in a formula-text button
var text Update=URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_10=1"& "&apptoken=xxxxxxxxx";
var text URL = "javascript:" &"$.get('" & $Update & "',function(){" &"$.jGrowl(�Item Marked Completed�, {life: 5000, theme: 'jGrowl-green'});" &"});" &"void(0);";
"<a class='Vibrant Danger' href=\"" & $URL &"\"" & ">Mark Completed" & "</a>" - StephenStephenQrew Assistant CaptainDo I have to onload anything? Does the jGrowl just work?