Forum Discussion
XavierFan
11 years agoQrew Cadet
In your Issues table:
Numeric field: [Number of Votes] (set the default value to 0, or 1 - as you prefer)
Formula Numeric field: [Next Number of Votes] (formula = [Number of Votes] + 1 )
Formula URL field: [Me Too]
Formula:
var text URLOne = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=XXXXXX"
& "&_fid_YYYY=" & [Next Number of Votes];
var text URLTwo = URLRoot() &"db/" & Dbid() & "?a=dr&rid=" & [Record ID#];
$URLOne & "&rdr=" & URLEncode($URLTwo)
Notes:- replace "XXXXXX" with your application token, YYYY with the field ID of your [Number of Votes] field- URLOne edits the record that the button is sitting on, overwriting the value in [Number of Votes] with the value in [Next Number of Votes] (i.e. fills it in with [Number of Votes] + 1)- URLTwo redirects to the View version of the same record- string URLOne and URLTwo together - and when you press the button, the [Number of Votes] increments, and the page refreshes to the View version of the record
Numeric field: [Number of Votes] (set the default value to 0, or 1 - as you prefer)
Formula Numeric field: [Next Number of Votes] (formula = [Number of Votes] + 1 )
Formula URL field: [Me Too]
Formula:
var text URLOne = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=XXXXXX"
& "&_fid_YYYY=" & [Next Number of Votes];
var text URLTwo = URLRoot() &"db/" & Dbid() & "?a=dr&rid=" & [Record ID#];
$URLOne & "&rdr=" & URLEncode($URLTwo)
Notes:- replace "XXXXXX" with your application token, YYYY with the field ID of your [Number of Votes] field- URLOne edits the record that the button is sitting on, overwriting the value in [Number of Votes] with the value in [Next Number of Votes] (i.e. fills it in with [Number of Votes] + 1)- URLTwo redirects to the View version of the same record- string URLOne and URLTwo together - and when you press the button, the [Number of Votes] increments, and the page refreshes to the View version of the record