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

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • Answered
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?

Photo of Eric Evans-Vargas

Eric Evans-Vargas

  • 586 Points 500 badge 2x thumb

Posted 4 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,542 Points 50k badge 2x thumb
Can you post the code for your add child button?
Photo of Eric Evans-Vargas

Eric Evans-Vargas

  • 586 Points 500 badge 2x thumb
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
(Edited)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,542 Points 50k badge 2x thumb
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)
Photo of Eric Evans-Vargas

Eric Evans-Vargas

  • 586 Points 500 badge 2x thumb
YOU.
ARE.
MY HERO!!!!

It worked. 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,542 Points 50k badge 2x thumb
Thx for letting me know :)