Forum Discussion

BenjaminBrooks's avatar
BenjaminBrooks
Qrew Trainee
5 years ago

Api Button to Change status and then add task

Hello All.

I am trying to make a button that changes the status of a record and then adds a record to the tasks table in edit mode below is the code that i have used. It is changing the status but not redirecting to the tasks record:

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=xxxxxxxxxxxxxxxxxxx" &
"&_fid_32=Call Back" &
"&rdr=" &
URLRoot() & "db/" & [_DBID_TASKS] & "?a=API_GenAddRecordForm"
& "&_fid_10=" &URLEncode(ToText(User()))
& "&_fid_15=" & URLEncode("Sales")
& "&_fid_8=" & URLEncode("Call Back")
& "&_fid_14=" & URLEncode ([Phone Number])
& "&z=" & "Rurl()"

------------------------------
Benjamin Brooks
------------------------------
  • You have to do successive API calls like this

    var text EDIT = 
    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=xxxxxxxxxxxxxxxxxxx" &
    "&_fid_32=Call Back";

    var text Add = 
    URLRoot() & "db/" & [_DBID_TASKS] & "?a=API_GenAddRecordForm"
    & "&_fid_10=" &URLEncode(ToText(User()))
    & "&_fid_15=" & URLEncode("Sales")
    & "&_fid_8=" & URLEncode("Call Back")
    & "&_fid_14=" & URLEncode ([Phone Number])
    & "&z=" & "Rurl()";

    $Add
    & "&rdr=" & URLEncode($Add)

    ------------------------------

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • BenjaminBrooks's avatar
      BenjaminBrooks
      Qrew Trainee
      Thank you Mark I am working on those variable tags to figure out when to use them !

      ------------------------------
      Benjamin Brooks
      ------------------------------