Skip to main content
Question

How to Copy Record and Copy Children

  • March 22, 2017
  • 0 replies
  • 270 views

My QB has a table of "Invoices". Each month the users "copy" the invoice for the new month. Most fields stay the same, including a list of children "Lines". When they copy an invoice, the child lines are not also copied. Why is this?

As per many-to-many rules, I created a "hidden" Invoice-to-Line table that is just the "Related Invoice" and "Related Line" (and the fields in the relationship). I guess I need to have QB create new entries in Invoice-to-Line when an Invoice is copied, with all of the Lines connected to the new Invoice.

Is this possible? (An Invoice can have up to 200 Lines, so this is a requirement for the users.) How do I implement this?

Thanks in advance!

This topic has been closed for replies.

  • Registered
  • March 22, 2017
Some background:
https://help.quickbase.com/api-guide/api_copymasterdetail.html

A  video:
https://www.youtube.com/watch?v=oXb2-rqtgaU

And the wizard:
is in your app setting.


Let us know if you get stuck or have more questions.

Forum|alt.badge.img+12
  • Registered
  • March 23, 2017
When you go into the CopyMasterDetail "wizard" it will ask you how you want to set it up.  You can either set it up so that you "copy" the record you're on and all the children from its relationships or you can set it so that it will copy a "specific" parent's child records.

In your case, I imagine that you will want to "copy" your Invoice from one month to the next with all the children in tow; and then just modify the Invoice details (like the Invoice # for example).

When you finish setting this up, QuickBase will create a button for you in your table (you get to name it as part of the setup).  You then put this on your Invoices so you can copy them when you want to.  If you choose "this" setup; I recommend also creating a dedicate text-field in your Invoices table called [Copy].  So when the feature copies your invoice and line items; that the "Copy of" text can go directly into this field instead of a valid-data field which it would otherwise do.

If you then need some kind of "dynamic" Invoice Numbering method; you will need this to work from some kind of formula which probably would reference/include the Date somehow and the Record ID# of the Invoice that gets created.

This is actually the perfect native solution for your needs; if you need help working through it in your App, I'm sure that Matthew, Mark or myself can help - I see that you were having trouble finding your Invoices table in the drop down.

  • Author
  • Registered
  • April 3, 2017

Hi all - I wanted to update this post now that I've found the problem. (Actually it was a co-worker of mine who figured it out.) My "Invoices" table was not showing up in the list because it had a conditional relationship with Invoice-to-Line. I was attempting to limit the Lines you could connect to an Invoice based on a shared field, and thus created the condition. By removing the condition, Invoices appeared in the CopyMasterDetail and now my "copy invoice" button works great.

Thanks for all your help!


  • Registered
  • June 28, 2018
I am trying to create a copy button on a table called Actions, but like Sarah above, it is not listed as as a table option in App Management. What can I do to get the table to show up, so that I can copy action items?

Once that problem is solved, is there a way to put the button in grid edit? We need to create the same action item on multiple projects. We will just need to change the project name for each action.