Forum Discussion
QuickBaseCoachD
10 years agoQrew Captain
Here is my current best version. This one is setting a checkbox to be checked.
var text URL = URLRoot() & "db/" & "?act=API_EditRecord&_fid_80=1&rid=" &
[Record ID#];
"ja ascript:" &
"$.get('" &
$url &
"',function(){" &
"$.jGrowl('This Item has been put on PO CANCEL snooze', {life: 5000, theme:
'jGrowl-green'});" &
"});" &
" oid(0);"
The 5000 means 5 seconds until it fades away. I like this version as it the same green color as the native QuickBase pop ups.
Note that when you do these kind of pop ups, the pop-up will show a success message even if the URL formula completely fails. So it's up to you to be sure that there is no possible way that the URL formula will fail.
var text URL = URLRoot() & "db/" & "?act=API_EditRecord&_fid_80=1&rid=" &
[Record ID#];
"ja ascript:" &
"$.get('" &
$url &
"',function(){" &
"$.jGrowl('This Item has been put on PO CANCEL snooze', {life: 5000, theme:
'jGrowl-green'});" &
"});" &
" oid(0);"
The 5000 means 5 seconds until it fades away. I like this version as it the same green color as the native QuickBase pop ups.
Note that when you do these kind of pop ups, the pop-up will show a success message even if the URL formula completely fails. So it's up to you to be sure that there is no possible way that the URL formula will fail.
- SumedhaWeerasur7 years agoQrew CadetHey Mark, This neat! But for some reason i have having some trouble getting it to work.
I created a url button and pasted in your code. The Javascript executes and i see the green message. But the checkbox field i have in fid_24 is not getting toggled.
My modified code is below
var text URL=URLRoot() & "db/" & "?act=API_EditRecord&_fid_24=1&rid=" & [Entry Number];
"javascript:" &
"$.get('" &
$url &
"',function(){" &
"$.jGrowl('This Item has been put on PO CANCEL snooze', {life: 5000, theme: \n'jGrowl-green'});" &
"});" &
" oid(0);"
can you spot anything weird with it? - QuickBaseCoachD7 years agoQrew CaptainIt probably needs an apptoken or else you need to disable app tokens in the Advanced properties for the app.
The way to test that is to comment out or remove the whole javascript block and replace it with just
$URL
That will run the edit and expose the XML error or success message.
If you need an app token the formula would look like
var text URL=URLRoot() & "db/" & "?act=API_EditRecord&_fid_24=1&rid=" & [Entry Number]
& "&apptoken=xxxxxxxxx";
The Advanced Properties of the app is where you manage app tokens. App Tokens are an extra layer of security. I usually turn them off unless my client has some super sensitive data, such as HIPPA health records
- SumedhaWeerasur7 years agoQrew CadetHmm, this is still not working for me tho. I tried it with an with and without an apptoken.
var text URL=URLRoot() & "db/" & "?act=API_EditRecord&_fid_24=1&rid=" & [Entry Number]
"javascript:" &
"$.get('" &
$url &
"',function(){" &
"$.jGrowl('This Item has been put on PO CANCEL snooze', {life: 5000, theme: \n'jGrowl-green'});" &
"});" &
" oid(0); - SumedhaWeerasur7 years agoQrew CadetIs there a specific workflow that one needs to go through to get this to work? Like the record needs to be open? And the checkbox needs to be un checked may be?
- QuickBaseCoachD7 years agoQrew Captainwhat does it do when you debug it by simply running the URL and removing the javascript code temporarily? as per my suggestion above.
- SumedhaWeerasur7 years agoQrew CadetI just tried it. I am getting this error. Also dose this formula only change the once? so the button wouldnt work after one click?
- QuickBaseCoachD7 years agoQrew CaptainIn my post above I said to include the line $URL after your formula variable line to run the formula. That will expose the error.
var text URL=URLRoot() & "db/" & "?act=API_EditRecord&_fid_24=1&rid=" & [Entry Number];
$URL - SumedhaWeerasur7 years agoQrew Cadet
Oh im sorry. Yes you did. Here is the error i am getting. [ Thank you so much for your help with this! ] - QuickBaseCoachD7 years agoQrew CaptainI cannot read that. Its too small to read. Please copy and paste the actual text.
- SumedhaWeerasur7 years agoQrew CadetHere you go
<qdbapi>
<action>API_EditRecord</action>
<errcode>32</errcode>
<errtext>No such database</errtext>
<errdetail>
The application does not exist or was deleted. If you followed a link to get here, you may want to inform the author of that link that the application no longer exists.
</errdetail>
<dbid>-b</dbid>
</qdbapi>