Forum Discussion
24 Replies
Sort By
- _anomDiebolt_Qrew EliteYou are probably missing the application token. Be that as it may be, the only JavaScript you should put into a QuickBase formula is a $.getScript() call and place all of your functional JavaScript in a user defined page. module.js. You are just asking for trouble writing JavaScript in a formula as there will constantly be character escaping issues Moreover, even if you only want your JavaScript to run on a button click you should use the image onload technique and put an event handler in the user defined page module.js rather than jam a callback or or an inline onload handler in your formula.
- QuickBaseCoachDQrew Captainsorry Chris,
just updated my formula above
var text URL = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&_fid_9=1&rid=" & [Record ID#]; - _anomDiebolt_Qrew EliteQBC>Dan Dielbolt would admonish us that that is a deficiency of this URL for Dummies approach.
Read the book:
http://i.imgur.com/NZP7Si2.jpg
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=294 - Chris_MCDChris_Qrew MemberI am now getting this error,
Formula syntax error
A variable declaration must end with a semi-colon.
var text URL = URLRoot() & "db/" & dbid() "?act=API_EditRecord&_fid_9=1&rid=" & [Record ID#];
"javascript:" &
"$.get('" &
$url &
"',function(){" &
"$.jGrowl('This Task has been completed', {life: 5000, theme: 'jGrowl-green'});" &
"});" &
"void(0);" - QuickBaseCoachDQrew Captainvar text URL = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&_fid_9=1&rid=" & [Record ID#];
- Chris_MCDChris_Qrew MemberOk, I think I got it now. But let me ask you this... in testing this out, I have clicked the button, and then went into the record to make sure it worked, and the first time it did. But then once I have changed it back and then tried it again, it no longer worked. Why is that? I still worked on a different record when I tried it on that one.
- QuickBaseCoachDQrew CaptainIt should work consistently every time. No way it would not work for a simply update like that. Please test again.
- Chris_MCDChris_Qrew MemberI have actually tried it 3 times now, twice with my companies system an another with the other company I work with. It seems as though once you change a record using the button, then update that record back to its original state, when you go through the process again, the button no longer works on that record. Something must change about it. I don't see this really being an issue as once the button is used on a record, there really is no reason to change it back in most cases. I was just simply testing it out.
- QuickBaseCoachDQrew Captainmaybe make this minor chnage
var text URL = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&_fid_9=1&rid=" & totext([Record ID#]); - _anomDiebolt_Qrew EliteTry Plan B: script using the image onload technique. It always works the first time!