Forum Discussion

DavidDavid10's avatar
DavidDavid10
Qrew Member
11 years ago

Trying to use the Copy Master-Detail function, but only to copy detail records and not the parent record.

The app I'm working with has a top-level table for customers. Below that is a table for projects, with multiple levels below that. I need to be able to either use the Copy Master-Detail or write a new formula so that I can have the button at the customer level, but not have it create a master record.

For instance, I have Customer A. He has 2 projects (child records). I want to be able to create a quick project using the most recent project record and all of its child records, but from the Customer level.

Using the CopyMasterDetail function means the create button either lives on the Project table; or if I put it at the customer level, it creates a new customer. What do I have to alter in the function to have it look at a specific record ID on the projects table and then have it copy that project record and all of its child records?

  • This is possible to do, but depending on your comfort level with QuickBase you may want to get a developer to help you.

    When you make a button to copy in the children records from a specific parent to the parent you are sitting on the URL looks like this

    "javascript:void(copyMasterDetailButtonHandler('&sourceRID=63&destrid=" & [Record ID#] & "', 'bfv72ften'))"

    In he example above, the record ID 63 is the Project from which the children will always be copied.


    So, you could make that field and then modify it to substitute in the Parent which has the children you want to copy in. You could have a table with one record ID in it and a field to hold the value of the Parent record that you want to copy from. Then make a URL formula button which the user would click to update that record with the value of the record ID they are sitting on as a source parent.


    The value on that field would be then carried down to all the Parent records in a lookup called pergaps [Source Record ID#]

    That URL formuakl would them be modified to read



    "javascript:void(copyMasterDetailButtonHandler('&sourceRID=" & totext([source record id#]" & "&destrid=" & [Record ID#] & "', 'bfv72ften'))"




    Then they would go to the target parent and click the Copy button and the children form the identified source would be copied to the child. I would have a field on the target parent show to let the user know information about which parent's children will be copied in.


    There are a few steps involved to make that work and you can either work though any issues that you encounter, or else contact me via the information in my profile if you want me to set this up for you.