Forum Discussion

Re: Error from URL Formula

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
------------------------------

6 Replies

  • 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
      ------------------------------
    • AdamKeever1's avatar
      AdamKeever1
      Qrew Commander
      Good news. Way to stick with it!

      ------------------------------
      Adam Keever
      ------------------------------
    • Quick_BaseJunki's avatar
      Quick_BaseJunki
      Qrew Captain
      Hi George!

      You don't necessarily need Javascript, just an "rdr" redirect.

      URLRoot() & "db/" & Dbid() &
      "?act=API_EditRecord&rid=" & [Record ID#] &

      "&_fid_8=" & Today() &
      "&_fid_9="& "RECEIVED" &
      "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#] )

      ^^ or you can set the location to somewhere else in your app by adjusting what comes after the "?"

      If you want to learn the ins and outs of building APIs for Quick Base Buttons you can check out a course I offer here.

      ------------------------------
      Sharon Faust (QuickBaseJunkie.com)
      Founder, Quick Base Junkie
      https://quickbasejunkie.com
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        One of advantage of the JavaScript refresh syntax is that it will refresh the page that you are on, so that means that it will refresh either the record or the report that you are on as opposed to dropping the user necessarily back on displaying the record.
        So for example if there were a whole series of records to mark as  received on a report of Open receiving you could just keep clicking the ones that you've received on the report would refresh one record shorter after every click. 


        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------