Forum Discussion

KimRavizza's avatar
KimRavizza
Qrew Cadet
3 years ago

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...
  • MarkShnier__You's avatar
    3 years ago
    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
    ------------------------------