Forum Discussion
JoshuaKrohn
6 years agoQrew Member
Yes. Buttons like this require some understanding of the QuickBase API, and once you have that so many doors will be open to you!
Also, check out an application in the marketplace called Magic Buttons. It's basically a bunch of sample buttons that you can copy code from to get the framework for what you want to do. I think all you'll need to do is a few EditRecord calls and you'll be set. Note that in that app, the builder gives examples for both Text and URL versions, but I don't believe the Text versions are supported anymore, so you'll have to use the URL versions. Give that a go and let me know if you're having any difficulty.
------------------------------
Joshua Krohn
------------------------------
Also, check out an application in the marketplace called Magic Buttons. It's basically a bunch of sample buttons that you can copy code from to get the framework for what you want to do. I think all you'll need to do is a few EditRecord calls and you'll be set. Note that in that app, the builder gives examples for both Text and URL versions, but I don't believe the Text versions are supported anymore, so you'll have to use the URL versions. Give that a go and let me know if you're having any difficulty.
------------------------------
Joshua Krohn
------------------------------
- MarkShnier__You6 years ago
Qrew Legend
Here is an example below. In addition to Kirk Trachy's Magic Buttons app, there is also an app I put in the Exchange called URL formulas for Dummies.
var text URL =
URLRoot() & "db/" & Dbid () & "?act=API_EditRecord&rid=" & [Record ID#]
& "apptoken=xxxxxxxxx"
& "&_fid_12="&URLEncode("Yes") // set fid 12 field to Closed
& "&_fid_13="&URLEncode(ToText(User)) // set fid 13 field to the text value of the current user
& "&_fid_14="&URLEncode("Approved") // set fid 14 field to Approved;
"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);"
Notes:
You only really ned to do the URLEncode if the values will contain spaces or unusual characters.
The line in bold may be omitted if you disable the need for Application Tokens.
What that formula does is to set up a formula variable called URL with what the API needs to do. Then that javascript stuff runs the formula variable called URL and refreshes the page.
Notes that if you have errors in the URL, that particular syntax will not reveal the error message. to debug, you would need to comment out or remove out that javascript and just run the URL. Then once its working, put back the syntax above.
If you run into any problems, post your formula and the error message.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
markshnier2@gmail.com
------------------------------