Blog Post

The Qrew Blog
1 MIN READ

Trying to redirect to the parent table after saving/editing a record.

DanSupport_'s avatar
DanSupport_
Quickbase Staff
8 years ago
Originally posted in previous community:
  • Asked by Dan
  • 21 days ago
By default it goes to the record that was saved/edited.
Published 8 years ago
Version 1.0
  • DanSupport_'s avatar
    DanSupport_
    Quickbase Staff

    14 comments

    Where are you "launching" the add record or edit record from? A report?

    From the parent table. I have a table called "Messages" and create a new record called "Message." Upon editing or saving I would like it to redirect to the "Messages" table NOT the "Message" record itself.

    • Dan
    • 21 days ago

    Post your [Add a Message] formula so we can see what redirects it has if there are any.


    Where would I find that? I am just using he default add/save buttons. I am a QB newbie...

    • Dan
    • 21 days ago

    If you edit a record off a report, the default behavior is to land you back in the report when you save. is that what you are experiencing and is that the behavior that you want? When you add a record using the big green Add Record button on the Table Home Page, it will land you on the record. if you instead make an Add Record button on your Dashboard, then you have two useful choices when you save, either land on the record or to come back to the Dashboard (or a different dashboard)


    I am trying to edit the record from the record itself. I view an individual record, then click the edit button and make my desired changes. Then click save. From there I would like it to redirect back to the Table view, NOT the record view itself.

    • Dan
    • 21 days ago

    If you edit the record off the report and then save, it will return you to the report that you came from. But here is a formula which you can use as a field type of Formula-URL which will edit the record and then return you to the table Home Page. So you can create this field and then put it on your form.


    Thanks for the formula, but this does not do what I'm looking for. This saves the record and reopens it to be further edited. I simply want to return to the Table view of the records when saving.

    • Dan
    • 21 days ago

    I tested that formula and it works. Can you post the formula that you are using and let me know the field type?


    I created a Formula-URL field and this is the formula I used... var text URLONE = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & ToText([Record ID#]); var text URLTWO = URLRoot() & "db/" & Dbid() &"?a=td"; $URLONE & "&NextURL=" & URLEncode($URLTWO) It saves the record but does not redirect me anywhere. I am now in an updated edit record state.

    • Dan
    • 21 days ago

    Well that is pretty odd, considering that i did test the formula.   If you like you can contact me via the information in my profile and I will have a quick look on a GotoMeeting.


    I sorted this out. Dan was clicking the button in edit mode, instead of the green Save button. He will now hide that button in edit mode.


    If you want it green..... like the regular save button

    Try This:
    Create a new Formula-Text Field
    >
    Insert this formula (then you'll need to change some variable)
    >

    "<a class='Vibrant Success'  onclick=' DoSaveAdd()' href='"&URLRoot()&"db/" & [_DBID_CLIENTS] & "?a=dr&rid=" & [Related Athlete] & "&dfid=13'>Save & Show Parent Record</a>"

    Change the "CLIENTS" in the [_DBID_CLIENTS] to the dbid for your parent table. (Probably MESSAGES)
    Change the [Related Athlete] to your [Related Messages] (i.e. Parent reference field)
    Change the text of the button to whatever you'd like.

    Put this field at the top and/or bottom of your form, and done.


    you can remove the &dfid=13 part. (I copied it from a different app) "Save & Show Parent Record"

  • I tried this...it redirects to the parent, but it does not save the child record:

    "<a class='Vibrant Success'  onclick=' DoSaveAdd()' href='"&URLRoot()&"db/" & [_DBID_VIP] & "?a=dr&rid=" & [Related VIP Traveler] & "'>Save</a>"
  • That post seems quite unrelated to the thread. Perhaps you should post a new question explaining your use case. IMHO, the best way to redirect after the save is if you can add code to the button that puts up the add record form or the edit record form.