Forum Discussion

JulieMeeker's avatar
JulieMeeker
Qrew Trainee
2 years ago

Trying to redirect back to report

I have a button that sets a checkbox and a timestamp and I would like to redirect back to the report.  I have added the native return to where you cam from but I get an error.  Here is my formula:

URLRoot() & "db/" & Dbid() &
"?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&_fid_34=" & true &
"&_fid_35=" & Now()&
"&z=" & Rurl()

Here is the error:

<qdbapi>
<action>API_EditRecord</action>
<errcode>0</errcode>
<errtext>No error</errtext>
<rid>3028</rid>
<num_fields_changed>1</num_fields_changed>
<update_id>1678144272405</update_id>
</qdbapi>
When I put in the statement to redirect to the saved record, it works.  It is setting the fields so the edit is working.  How can you redirect back to the report that the button was clicked from?


------------------------------
Julie Meeker
------------------------------

2 Replies

  • np, you need a two step button to do your edit and then refresh the page.

     var text URL = URLRoot() & "db/" & Dbid() &
    "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&_fid_34=" & true &
    "&_fid_35=" & Now();

     var text RefreshPage =  URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();

     
    $URL
    & "&rdr=" & URLEncode($RefreshPage)



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Qrew Champion

      This would be slightly better written like this

      "&_fid_35=now";

      The nuance is that your original syntax will be the time the page loaded, which could go stale if the exact time matters in your use case. The second syntax will be the time that the button was clicked. 



      ------------------------------
      Mark Shnier (Your Quickbase Coach)
      mark.shnier@gmail.com
      ------------------------------