Forum Discussion

PaulPeterson1's avatar
PaulPeterson1
Qrew Assistant Captain
4 years ago

Formula URL Help Needed

I am not overly comfortable debugging formula URLs.  I have two questions.  First, I am using a button to trigger a pipeline.  The button is in an embedded report and currently when clicked it is going to the form view.  I would like the result of the button click to be adding a check in a checkbox then returning to the report view.  This is what I have now:

URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=tokenmID&rid=" & [Record ID#] & "&_fid_80=1" &
"&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])

What do I need to change.

Secondly, what is the best resource so I can learn more about this rather than constantly asking for help?

------------------------------
Paul Peterson
------------------------------
  • UrsulaLlaveria's avatar
    UrsulaLlaveria
    Qrew Assistant Captain
    Hi Paul, so you currently have your button redirecting back to the record:
    Redirect: &rdr=" & URLEncode(URLRoot() & "db/" &
    TABLEid: Dbid() & "
    View Record: ?a=dr&
    Record ID: rid=" & [Record ID#]

    If you want it to redirect you have to send it to the URL of the report. TO find the Report ID, look at the qid in the URL of the report page:
    View Report: ?a=q&
    Report ID: qid=REPORTID

    So your url should look similar to this:
    URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=tokenmID&rid=" & [Record ID#] & "&_fid_80=1" &
    "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=q&qid=" & REPORTID)

    I found these things through the community, but I am sure there is documentation on this somewhere.
    ------------------------------
    Ursula Llaveria
    ------------------------------
    • PaulPeterson1's avatar
      PaulPeterson1
      Qrew Assistant Captain
      That worked!!

      Thank you!!!

      ------------------------------
      Paul Peterson
      ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend
      Another approach when you simply want to refresh the page is that they recently gave us a new syntax. The advantage of this is that it will refresh the record if you click the button when you're on the record and it will refresh the report if you happen to be on a report. It would also refresh the page even if you were sitting on a Child table (or even just a report link non-child record) on an embedded record on the form. 

      I like this consistent Syntax.

      var text URL = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=tokenmID&rid=" & [Record ID#] & "&_fid_80=1";

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

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

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

      The generic syntax for successive URLs is this below and you just slice off as much of the salami as you need.   in you use case I took two slices.

      $URLONE
      & "&rdr=" & URLEncode($URLTWO)
      & URLEncode("&rdr=" & URLEncode($URLTHREE))
      & URLEncode(URLEncode("&rdr=" & URLEncode($URLFOUR)))
      & URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLFIVE))))
      & URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSIX)))))


      ------------------------------
      Mark Shnier (YQC)
      mark.shnier@gmail.com
      ------------------------------
      • UrsulaLlaveria's avatar
        UrsulaLlaveria
        Qrew Assistant Captain
        This is great Mark, thank you!

        ------------------------------
        Ursula Llaveria
        ------------------------------