Discussions

 View Only
Expand all | Collapse all

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

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

    Posted 12-27-2018 17:29
    I have a Parent table (VIP) where I am trying to add a Child record (VIP Request Record) but have the landing (after saving the child) to be on the parent record.
    The launch into adding a child record will be off of a report on a homepage, using a custom button.

    I tried the method referenced in this question: 
    https://community.quickbase.com/quickbase/topics/trying-to-redirect-to-the-parent-table-after-saving-editing-a-record
    But the outcome is not as expected; the redirect to the parent record is happening however my child record is not saving.

    My formula:
    "<a class='Vibrant Success'  onclick=' DoSaveAdd()' href='"&URLRoot()&"db/" & [_DBID_VIP] & "?a=dr&rid=" & [Related VIP Traveler] & "'>Save</a>"

    Where [_DBID_VIP] is my Parent table and [Related VIP Traveler] is my Parent record.

    What am I doing wrong?



  • 2.  RE: Trying to redirect to the parent table after saving/editing a record.

    Posted 12-27-2018 17:38
    Can you post the code for your add child button?


  • 3.  RE: Trying to redirect to the parent table after saving/editing a record.

    Posted 12-27-2018 18:08
    It's a Formula URL field where the user must enter notes:
    URLRoot() & "db/" & [_DBID_VIP_INTAKE] & "?a=API_GenAddRecordForm&_fid_6=" & URLEncode ([Record ID#])& "&z=" & Rurl()

    Where fid 6 is the related parent record


  • 4.  RE: Trying to redirect to the parent table after saving/editing a record.

    Posted 12-27-2018 18:14
    I wonder if the problem is that you are launching off a report which is on the home page as opposed to a report on a table.

    No matter try this,

    var text AddChild =  URLRoot() & "db/" & [_DBID_VIP_INTAKE] & "?a=API_GenAddRecordForm&_fid_6=" & URLEncode ([Record ID#]);

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

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


  • 5.  RE: Trying to redirect to the parent table after saving/editing a record.

    Posted 12-27-2018 18:53
    YOU.
    ARE.
    MY HERO!!!!

    It worked. 


  • 6.  RE: Trying to redirect to the parent table after saving/editing a record.

    Posted 12-27-2018 18:54
    Thx for letting me know :)