Forum Discussion
QuickBaseCoachD
8 years agoQrew Captain
Ryan,
Are you looking for a checkbox or a URL formula button button to perform some edits to the record?
Are you looking for a checkbox or a URL formula button button to perform some edits to the record?
MCFNeil
8 years agoQrew Captain
The general structure of a formula-url button that will edit a record (in view or edit mode) and then refresh the screen is like this:
var text URL= URLRoot() & "db/" & [_DBID_PO] & "?a=API_EditRecord&rid="&[Record ID#]&"&apptoken=xxxxxxxxxxxxx
&_fid_113=1
&_fid_124=0
&_fid_115="&URLEncode(Now())&"
&_fid_116="&URLEncode(User())
;
"javascript:" &"$.get('" & $URL & "',function(){" &"location.reload(true);" &"});" & "void(0);"
The first part will do the "Edit" and the second forces a page refresh so you can see the new change.
The formatting for the specific fields you want to change are as such;
&_fid_(the Field ID that is to be changed)=(The value it needs to be changed to)
If you have numeric fields you can just have
=1234
Text fields or values with 'spaces' in them are best to use "URLEncode
var text URL= URLRoot() & "db/" & [_DBID_PO] & "?a=API_EditRecord&rid="&[Record ID#]&"&apptoken=xxxxxxxxxxxxx
&_fid_113=1
&_fid_124=0
&_fid_115="&URLEncode(Now())&"
&_fid_116="&URLEncode(User())
;
"javascript:" &"$.get('" & $URL & "',function(){" &"location.reload(true);" &"});" & "void(0);"
The first part will do the "Edit" and the second forces a page refresh so you can see the new change.
The formatting for the specific fields you want to change are as such;
&_fid_(the Field ID that is to be changed)=(The value it needs to be changed to)
If you have numeric fields you can just have
=1234
Text fields or values with 'spaces' in them are best to use "URLEncode