Forum Discussion

MichaelTamoush's avatar
MichaelTamoush
Qrew Captain
4 years ago

New Redirect (Doredirect)

Has anyone used the new 'doredirect' functionality? Are there any examples or instructions for implementing this bit of code that was updated in the last relaese?

I think the basics is ""?a=doredirect&z=" &Rurl())

but I am not sure if you have to specify the table first, or if there is a way to add that code and have it simply redirect to where the person was when they pressed the formula button?

------------------------------
Mike Tamoush
------------------------------
  • Here is an example doing three URL calls and then refreshing the page. It's a silly example where I separately edit the same record three times, but I was just trying to test.



    var text URLONE = URLRoot() & "db/" & [_DBID_PARENTS] & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_6=today";
    var text URLTWO = URLRoot() & "db/" & [_DBID_PARENTS] & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_11=now";
    var text URLTHREE = URLRoot() & "db/" & [_DBID_PARENTS] & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_12="
    & not ([Checkbox]);

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



    $URLONE
    & "&rdr=" & URLEncode($URLTWO)
    & URLEncode("&rdr=" & URLEncode($URLTHREE))
    & URLEncode(URLEncode("&rdr=" & URLEncode($RefreshPage)))

    The main point is that you need his whole string to refresh the page

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

    so, for example if it was just 1 URL to execute and Refresh the page it would be

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

    or else in long form that I don't use as I far prefer small code parts to debug ....

    URLRoot() & "db/" & [_DBID_PARENTS] & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_6=today"
    & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl())










    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • MichaelTamoush's avatar
      MichaelTamoush
      Qrew Captain
      Do you know if you can use this to redirect if you started in a different table?

      i.e: I'm in a record with an embedded report link from another table. If I have a button press in that report link, is it possible to use doredirect to navigate back to the form where you started? (the 'parent' record....even though technically it might not really be a parent, but for the purpose of this example we can pretend its a child table with a button, that is pressed from the embedded report link on the parent table)

      ------------------------------
      Mike Tamoush
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        I don't think I personally tested that but yes that is the intent of the code. It is remembering what page you were on when you click he button, even if it was on an unrelated child table Report Link. 

        It is like an F5 refresh the page type function.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------
    • KeithHendrick's avatar
      KeithHendrick
      Qrew Member
      The doredirect is returning inconsistent results for me. The formula below sets field ID #50 to "True" (it's a checkbox field). Sometimes it returns back to the report from which it was launched (which is the desired action), but other times it returns back to the app's dashboard page? I tried it with several records and several times and it seemed totally random as to where it would return, no pattern at all. Anyway, am I doing anything wrong in the formula below? Thanks.

      URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [PO #] & "&_fid_50=" & URLEncode("TRUE") & "&rdr="&URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl())

      ------------------------------
      Keith Hendrick
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        I would write it like this but I don't think there is anything"wrong" with your syntax.

        URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [PO #] & "&_fid_50=1"
        & "&rdr="&URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl())


        You should report this to support. I'd be curious if my alternative allows it to behave better.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------
  • Thanks so much Mark for showing those examples, we also updated our original article on redirects to include examples of how the new functions work and you can find it here. If you see any examples that would be helpful we are missing certainly let us know.

    ------------------------------
    Evan Martinez
    Community Marketing Manager
    Quickbase
    ------------------------------