Forum Discussion

JasonBeaver's avatar
JasonBeaver
Qrew Cadet
7 years ago

URL Button to add a child record to a parent record

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.
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    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.
  • 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?
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      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.