URL Button to add a child record to a parent record

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • In Progress
I am needing to add a child record to a parent record with the click of a button. Need some help with the coding of this URL button.  

I want this button to be pushed when the child record is to ready to be saved.

So basically I need the button to do the following:

Save the child record
Open the parent record
Add the child record to parent
Save the parent record.

Any help would be appreciated.
Photo of Jason Beaver

Jason Beaver

  • 270 Points 250 badge 2x thumb

Posted 8 months ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
Jason, 
There are a few different ways to get this done, but most commonly used it the API_AddRecord call.  You can either pair that with a redirect or a page reload.  

The variations changed based on workflow and details needed be transferred during the 'click'.

There are a few resources out there to help you get started on this.  
One is the template app from the QB library.
""
Magic Buttons - Having fun with formula URLs
Created By Kirk Trachy
""

Another option is to work some expert builders "cough cough".

If you have more details or get stuck let us know.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Jason,
Can we rewind a bit?

Normally, you are sitting on a Parent Record and simply Add Child with the native built in Add Child button.

What is different about your situation?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
I cannot see how you could natively click a button (while sitting on a child record) to create a Parent, obtain its Record ID#, and then populate that to the child record as [Related Parent] and save the child.

The issue is that with native URL formula buttons you do not have a way to listen for the record ID which for the newly created parent.

Can you tell me the use case, maybe I have another suggestion.