Forum Discussion
XavierFan
12 years agoQrew Cadet
No problem. (channeling you here) =)
Basically - you want to replace this line:
"$.jGrowl('email Triggered to Prospect', {life: 5000});" &
with
"location.reload(true);" &
From the jQuery API documentation for $.get: https://api.jquery.com/jQuery.get/
The function being defined is the success function - that is executed if the request succeeds.
So instead of executing the Growl call in the success function, you execute the page refresh call.
I tested this on a test app, and it works even on reports with dynamic filters set.
Let me know if this works for you.
The formula URL would look something this (I used an EditRecord in my test as an example):
var text URL= URLRoot() & "db/" & [_DBID_TABLE_1] & "?act=API_EditRecord"
& "&rid=" & URLEncode ([Record ID#])
& "&_fid_7=" & URLEncode ([Status])
& "&apptoken=" & "XXXX";
"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);
Basically - you want to replace this line:
"$.jGrowl('email Triggered to Prospect', {life: 5000});" &
with
"location.reload(true);" &
From the jQuery API documentation for $.get: https://api.jquery.com/jQuery.get/
The function being defined is the success function - that is executed if the request succeeds.
So instead of executing the Growl call in the success function, you execute the page refresh call.
I tested this on a test app, and it works even on reports with dynamic filters set.
Let me know if this works for you.
The formula URL would look something this (I used an EditRecord in my test as an example):
var text URL= URLRoot() & "db/" & [_DBID_TABLE_1] & "?act=API_EditRecord"
& "&rid=" & URLEncode ([Record ID#])
& "&_fid_7=" & URLEncode ([Status])
& "&apptoken=" & "XXXX";
"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);
- TateForgey7 years agoQrew Assistant CaptainThis is great! I think I would like the growl notification in addition to the refresh, but I can't seem to get them both to work at the same time. Is that possible?
- QuickBaseCoachD7 years agoQrew CaptainAs far as I know you can refresh the page or jgrowl. Not both.
- TateForgey7 years agoQrew Assistant CaptainStill awesome!
- WendyShoef7 years agoQrew CadetI do both frequently. Here's my code:
var text action = URLRoot() & "db/" & Dbid() & "?a=API_editRecord&rid=" & [Record ID#] & "&_fid_=1;
var text url = "javascript:" &
"$.get('" & $action & "',function(){" &
"$.jGrowl('Growl Message', {life: 1000, theme: 'jGrowl-green'}); " &
"setTimeout(function(){ location.reload(); },1000);" &
"});" &"void(0);";
var text button = "<a class='Vibrant Primary' href=\"" & $url &"\">My button text</a>";
$button - CarrieKrakowski3 years agoQrew MemberHi there,
I realize this is a very old post and my issue may be because of this, but hoping to get some insight into how to do this.
I have a number field I'm trying to increase in a Kanban report with a button click, then refresh the data on the page (even better if we could use Ajax).
I'm trying to create this in a Formula - URL button but when I go to save , I get the error:
There are one or more problems with your entryOnly text, Quickbase-accepted functions, fields, variables, and certain HTML tags are allowed in this field. JavaScript is not supported.
Here is my code:
var text URL = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Task ID]
& "&apptoken=XXXXX"
& "&_fid_76=" & [Duration Plus One];
"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);"
Any help is much appreciated! Thanks!
------------------------------
Carrie Krakowski
------------------------------- MarkShnier__You3 years ago
Qrew Legend
Right, so they took away JavaScript from us and we used to use it to refresh the page. But they gave us a new replacement code. The code in bold below will refresh whatever page you are on even if you click a button on an embedded child report on a form for example.
Do you need the generic syntax below in this format.
$URLONE
& "&rdr=" & URLEncode($URLTWO)
So, in your use case you want to do the update and then you want to refresh the page.
var text URL = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Task ID]
& "&apptoken=XXXXX"
& "&_fid_76=" & [Duration Plus One];
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
$URL
& "&rdr=" & URLEncode($RefreshPage)
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------- CarrieKrakowski3 years agoQrew MemberBeautiful! Works perfectly. Thank you for the speedy response!
------------------------------
Carrie K
------------------------------