Forum Discussion

GeorgeBramhall2's avatar
GeorgeBramhall2
Qrew Cadet
5 years ago

Error from URL Formula

What have I done wrong (I suck at these)?
I have created this formula:
var text URLONE = URLRoot() & "db/" & Dbid()

& "?act=API_EditRecord&rid=" & [Record ID#] &

"&_fid_8=" & Today() &

"&_fid_9="& URLEncode("RECEIVED");

$URLONE

And I am getting this error:

<qdbapi>
<action>API_EditRecord</action>
<errcode>0</errcode>
<errtext>No error</errtext>
<rid>1</rid>
<num_fields_changed>0</num_fields_changed>
<update_id>1578420560656</update_id>
</qdbapi>


------------------------------
George Bramhall
------------------------------

7 Replies

  • Does your app have tokens enabled? If yes, then you need to add the token to your API.

    Try this with your token added in place of the X's:

    var text URLONE = URLRoot() & "db/" & Dbid()

    & "?act=API_EditRecord&apptoken=XXXXXXXXXXXXXXXXXX&rid=" & [Record ID#] &

    "&_fid_8=" & Today() &

    "&_fid_9="& URLEncode("RECEIVED");

    $URLONE

    ------------------------------
    Adam Keever
    ------------------------------
    • GeorgeBramhall2's avatar
      GeorgeBramhall2
      Qrew Cadet
      Thanks but I have tokens disabled. I figured out that I needed some javascript to reload where I left off.
      Here is the formula that works with the javascript:
      var text URLONE = URLRoot() & "db/" & Dbid()

      & "?act=API_EditRecord&rid=" & [Record ID#] &

      "&_fid_8=" & Today() &

      "&_fid_9="& URLEncode("RECEIVED");

      "javascript:" & "$.get('" & $URLONE & "', function(){" & "location.reload();" &
      "});" & "void(0);"

      ------------------------------
      George Bramhall
      ------------------------------
      • jasonjohnson1's avatar
        jasonjohnson1
        Qrew Cadet
        Little tip - if you ever plan on having a Date/Time field to fill in from a button use this URLEncode("today"). It will drop in the current time along with the date.

        ------------------------------
        jason johnson
        ------------------------------