Copy master and edit all detail records with one button

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

Has anyone come up with Formula-URL code to both copy the master (parent) record with all detail (child) records, easy enough, but then include in the same button a predetermined edit to each of the detail records replacing a few fields in each child?

For example: Let's say the master is an invoice and the details are the line items containing item description, quantity and price. The Formula-URL copies the master and all details but then continues by changing the price in each record to zero.

I know I can include a button on each record to manually replace the field in each record and I know I can include a formula in the edit form to replace the price after creating the new detail records when going into edit mode. But I want it to happen automatically upon creation of the new records. Is there any way to do this? Thank you.

Photo of Mark

Mark

  • 40 Points

Posted 4 years ago

  • 0
  • 1
Photo of QuickBasePros (Laura Thacker)

QuickBasePros (Laura Thacker), Champion

  • 6,396 Points 5k badge 2x thumb
When I had a need to do this; copy a parent and its children and then "edit" the parent and sometimes fields in the children; I had to do this by getting some custom-code written that would replicate the copy-master-detail process; and then cycle through the parent and children to make the changes. To my knowledge; you cannot customize the button that the copy-master-detail button runs to do this.

You could have a second button that modifies the parent after it's been created; but for the children you would then need a piece of code to "cycle through" them to make changes to each of them.

If you need this functionality from a single button to make the process slick, please contact me offline.
Can you tell me how the children will know what their new values should be for the field(s) to be edited?  I may have a Two button solution.
Photo of Mark

Mark

  • 40 Points
The new values are always the same for all children.  We're just blanking out some date fields.