Forum Discussion
np,
The API you posted is the one that can be used to put up an Add Record form to duplicate a record that you are sitting on, but it will not copy Children.
I am going to assume that your template child records are from Template Parent records of the same table you are on. ie you do not have a different tables for your templates, just the same tables for parent and children, but some of the Parents are special template record.,
While there is an API to copy parents and children here's what I suggest you do for the best user experience.
Go to the settings for the application and then Application management and then locate the link to the wizard which will create a button for you. Initially, just elect the option to copy the Children form the current Parent.
It will look like this
"javascript:void(copyMasterDetailButtonHandler('©Fid=8&destrid=0&sourcerid=" & [Record ID#] & "', 'xxxxxxxxx'))"
Then edit it to look like this.
"javascript:void(copyMasterDetailButtonHandler('©Fid=8&destrid=0&sourcerid="
& [Record ID# of the Parent template record]
& "', 'xxxxxxxx'))"
In order to have a field for which Parent's template children to use [Record ID# of the Parent template record] , I suggest that you make a relationship of the Parent table to itself, so the user can select the Template parent. The reason I suggest using this wizard which has permissible JavaScript, instead of the API format is that it has a nice behaviour in that once it creates the new parent it offers the option to the user to land on the new parent which is typically what they want.
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------