Forum Discussion

KimRavizza's avatar
KimRavizza
Qrew Cadet
3 years ago
Solved

Button to Update Date and stay in report

Hello,

I've created a button that, when clicked, updates a date. I've used this button many times in a form, but I want to use it in a report and stay in the report once the date is updated. Here's my formula for redirecting back to the form:

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &

"&rid=" & [Record ID#] &

"&apptoken=xxxxxxxxxxxxxxxxxxxx" &

"&_fid_33=Now" &

"&rdr=" & URLEncode(URLRoot()&"db/" & Dbid() & "?a=dr&dfid=12&rid="&[Record ID#])

The above redirects me to the actual record. I would like to redirect back to the report (a=q&qid=19) but not quite sure how to do that. Any help with this would be appreciated.

Thank you,

Kim

------------------------------
Kim
------------------------------
  • np,
    This magic code on the rdr Redirect will refresh whatever page you are on, so for example a report, or a record or even if you click the button on an embedded child record on the form it would refresh that form because it simply refreshes the Page you were on. 

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

    So use it like this,

    var text URL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=xxxxxxxxxxxxxxxxxxxx" &
    "&_fid_33=Now";

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

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

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------

3 Replies

  • np,
    This magic code on the rdr Redirect will refresh whatever page you are on, so for example a report, or a record or even if you click the button on an embedded child record on the form it would refresh that form because it simply refreshes the Page you were on. 

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

    So use it like this,

    var text URL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=xxxxxxxxxxxxxxxxxxxx" &
    "&_fid_33=Now";

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

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

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • KimRavizza's avatar
      KimRavizza
      Qrew Cadet
      Magic indeed! Works perfectly. 

      Thanks for always being so quick to help me Mark!

      Kim

      ------------------------------
      Kim
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew Champion
        There used to be a cool JavaScript snippet that we are used to do that function. When they took away JavaScript and heard the howls from the developer community about page refresh, Harrison Hersch (a Quickbase Product Manager) kind of threw us a bone and gave us this magic code.

        ------------------------------
        Mark Shnier (YQC)
        mark.shnier@gmail.com
        ------------------------------