Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Clone subform subform?

Post Reply
mobilemcclintic
Posts: 54
Joined: Fri Oct 23, 2015 12:34 am

Clone subform subform?

Unread post by mobilemcclintic »

Hello, I have a 3 level application
Quote
--Quote Items
----Quote Item Detail

Each quote may have many items and each item may have many details, (all the pieces or services that the item needs)
I can clone a quote and it clones the quote items, but it doesn't clone the quote item details.
Is there a way to programmatically make this work?
mobilemcclintic
Posts: 54
Joined: Fri Oct 23, 2015 12:34 am

Re: Clone subform subform?

Unread post by mobilemcclintic »

Obviously this musn't be supported in Nubuilder.
Is there a way to set an original ID before clone onto subform records so that I can run a php before open code to populate necessary fields?
I tried adding the code to change subform fields using nuOnClone as well as trying a custom extra action button that updates the subform fields before cloning, but since clone doesn't save the record, the updated fields aren't populated on the new record.
I tried to update the fields, save, and then clone on the extra action button as well, but it just updates the fields, clones the form (except the updated fields), and then attempts to save the form.

My next plan of action is figuring out timing of when to fill in an auxiliary field on the subform records with the subform record's _nuPrimaryKey so that I can systematically run a php script to update the fields with a query before open on the subform records full edit page.
I am trying to avoid having 50 or more fields on the subform which would allow easier cloning of the full record (except for grandchild records)
Post Reply