Forum Discussion

IvanWeiss's avatar
IvanWeiss
Qrew Captain
2 years ago

Redirecting back to the current form after executing a formula url button

Hello,

I have a few buttons that at the end redirect the user after execution the action to the "default" form for the table. How do I change this so the redirect goes to the current form the user is on? The button is on multiple forms and I want to redirect them back where they came from.

Thanks!

------------------------------
Ivan Weiss
------------------------------

6 Replies

  • MarkShnier__You's avatar
    MarkShnier__You
    Qrew #1 Challenger
    Can you post an example of your current code?

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • IvanWeiss's avatar
      IvanWeiss
      Qrew Captain
      It is actually the default add buttons for child tables.  Here is one of them but there are a bunch.  All same general format:

      URLRoot() & "db/" & [_DBID_COMMUNICATION_PLAN] & "?a=API_GenAddRecordForm&_fid_13=" & URLEncode ([Project Number])& "&z=" & Rurl()

      ------------------------------
      Ivan Weiss
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew #1 Challenger
        OK, so I am interpreting that this is your question.

        You have a parent table and it has a two forms. You launch and Add Child button off a Parent record and you want to make sure that when the child record is saved that you land the user in display mode on the specified form that you want.  

        I do not know of any way to actually detect what form the user is launching off of but I guess since you have different forms you can have different buttons for add child.  

        The syntax here should return the user to form number 10 on the parent record.  

        var text AddChild = URLRoot() & "db/" & [_DBID_COMMUNICATION_PLAN] & "?a=API_GenAddRecordForm&_fid_13=" & URLEncode ([Project Number]);

        var text ReturnToFormTen = URLRoot() & "db/" & dbid() & "?a=dr&dfid=10&rid=" & [Record ID#];

         $AddChild
        & "&NextURL=" & URLEncode($ReturnToFormTen) 


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