Forum Discussion
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.
- CarlosCarlos9 years agoQrew Assistant CaptainJust what I needed!! FYI, it works like a charm in reports as well!!
BIG THANKS! - CarlosCarlos9 years agoQrew Assistant CaptainIs there a way to implement this from a Formula-Text button, instead of a Formula-URL ??
Thanks - QuickBaseCoachD9 years agoQrew 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
) - ChrisChris9 years agoQrew Assistant Captain
Mark, Carlos
I cannot get either script to work. I am using a _fid_### of my own choosing, but not getting it populated.
Here is the formula URL script I'm using:
var text URL = URLRoot() & "db/" & "?act=API_EditRecord&_fid_158=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);"Here is the formula Text script:
var text Update= URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#])
& "&_fid_158=" & 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>"
Any assistance is appreciated.
Chris
- QuickBaseCoachD9 years agoQrew CaptainDo you have application tokens enabled or disabled? If they are enabled, then try disabling them while you are testing.
- CarlosCarlos9 years agoQrew Assistant CaptainIn the URL script it would seem you're missing the DBID() parameter as well.
App tokens definitely could be part of the issue.
What error do you get? - QuickBaseCoachD9 years agoQrew CaptainRight,
That URL formula should be
var text URL = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&_fid_158=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);" - ChrisChris9 years agoQrew Assistant Captain
Most of my apps have application tokens enabled for cross app relationships. I do not get an error message, the test text is just not written.
When I turn off application tokens, the scripts work, but I have to refresh the screen to see the result. Is that intended?
- CarlosCarlos9 years agoQrew Assistant CaptainIn this case yes. That's intended. Theres no redirect in the URL so you need to manually refresh to see the changes
- QuickBaseCoachD9 years agoQrew CaptainChris,
You need to add the application token to the URL.
var text URL = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&_fid_158=1&rid=" & [Record ID#] & "&apptoken=xxxxxxxxxxxxx";