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.commarkshnier2@gmail.com
------------------------------