Forum Discussion
MarkShnier__You
Qrew Legend
Right, so after you do an API call you need to land the user on a report or a record (or a page refresh) to suppress that XML response. So that means that you need to chain two steps successively.
The generic form to do two successive actions is this when written using formula variables (which i highly recommnend for formula readability).
$URLONE
& "&rdr=" & URLEncode($URLTWO)
The Refresh page which is the last step will look like this.
URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl())
so..
Putting it all together will look like this
var text Approve = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord"& "&rid=" & URLEncode ([Record ID#])&
"&_fid_Final Approval=1" & "&apptoken=" & "my token";
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
$Approve
& "&rdr=" & URLEncode($RefreshPage)
My last comment is that you have specified for field to edit using the field name. That will work, but if you chamnge the field name it will break. So I always refer to the field ID#
var text Approve = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord"& "&rid=" & URLEncode ([Record ID#])&
"&_fid_99=1" & "&apptoken=" & "my token";
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
$Approve
& "&rdr=" & URLEncode($RefreshPage)
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
The generic form to do two successive actions is this when written using formula variables (which i highly recommnend for formula readability).
$URLONE
& "&rdr=" & URLEncode($URLTWO)
The Refresh page which is the last step will look like this.
URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl())
so..
Putting it all together will look like this
var text Approve = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord"& "&rid=" & URLEncode ([Record ID#])&
"&_fid_Final Approval=1" & "&apptoken=" & "my token";
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
$Approve
& "&rdr=" & URLEncode($RefreshPage)
My last comment is that you have specified for field to edit using the field name. That will work, but if you chamnge the field name it will break. So I always refer to the field ID#
var text Approve = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord"& "&rid=" & URLEncode ([Record ID#])&
"&_fid_99=1" & "&apptoken=" & "my token";
var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();
$Approve
& "&rdr=" & URLEncode($RefreshPage)
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
PeterKrasznekew
4 years agoQrew Trainee
Mark, Thank you very much for your help. Button is now working as it should I edited the Field ID to display field number as well.
​
------------------------------
Peter Krasznekewicz
------------------------------
​
------------------------------
Peter Krasznekewicz
------------------------------