Skip to main content
Question

Add Record then Add Child to Record with Button Push

  • February 16, 2021
  • 0 replies
  • 161 views

Forum|alt.badge.img+14
If I want to use a button push to add a record, and then add a child to the record, is my only option to add record, then trigger an automation or pipeline as the second part of that button push?

I can't do it from the button push because I won't have the new record ID yet, correct?

------------------------------
Mike Tamoush
------------------------------

Forum|alt.badge.img+15
  • Registered
  • February 17, 2021
Mike,

What data is going into the Child?  If you want to add some sort of "standard" set of data then what you said will work.  

You can also embed a Grid Editable report into the Parent record.  You can add data there which Quickbase will magically associate with the New Parent on the Save.

------------------------------
Don Larson
Paasporter
Westlake OH
------------------------------

QuickBaseJunkie
Forum|alt.badge.img+15
Hi Mike, I saw your similar question on my YouTube channel, thanks for subscribing!

You can use a code page with a button.

It's not quite clear what your workflow is, but this combo will create a new parent record, then open new child record with the parent pre-populated with a single button click.

The button could be located on a form (using a formula or plain URL field) or on a dashboard.

Formula URL field (the button):
URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=10" //replace the URLRoot & AppID if not using a formula

Code Page:
<html>
   <head>
     <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
     <script>
        $.get('https://mycompany.quickbase.com/db/parent_dbid?a=API_addrecord',function(data,success) {
           var myrid = data.getElementsByTagName('rid')[0].innerHTML;
           location.replace('https://mycompany.quickbase.com/db/child_dbid?a=API_GenAddRecordForm&_fid_12=' + myrid);
        });
     </script>
   </head>
</html>

Let me know if this works for you 👍


------------------------------
Sharon Faust (QuickBaseJunkie.com)
Founder, Quick Base Junkie
https://quickbasejunkie.com
------------------------------