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
------------------------------
Loran Prince
Prince Finishing Inc
Edmonton's Premier Finishing Company
780-700-9057
8420 34A ave
Edmonton AB T6K 0C2
greatservice@princefinishing.com
- MarkShnier__You12 months ago
Qrew Legend
Can you tell me how many Parent Template records you have. If it's not too many, one solution is to just have a multiple choice field with the say 10 choices and then a hard coded calculation formula to calculate which Record ID to pull from.
In rethinking my suggestion, there is the possibility that if the related the table to itself in order to pull in the parent template record ID, the copy parent child may not allow that kind of what they call looping relationship.
so you an have a field like
Case([Project Type],
"Big", 123",
"Small", "124",
"Custom", "125")
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------- LoranPrince12 months agoQrew MemberHey Mark:
There would be an abundance of the templates over time. It is a job that has many tasks and depending on the job choice,, the tasks and values varry from template to template.
Can the loop be cancelled by having another app that pulls down the RID and name and then a formula field makes the RID just a number permanently with a snapshot? Or just with a snapshot field in the same app?
In my mind, the snapshot number is no longer connected to the RID, What do you think?
Loran Prince
Prince Finishing Inc
Edmonton's Premier Finishing Company
780-700-9057
8420 34A ave
Edmonton AB T6K 0C2
greatservice@princefinishing.com
- MarkShnier__You12 months ago
Qrew Legend
As soon as you make the parent table related to itself that will be a looping relationship so the Snapchot field will not solve the loop.
One solution could be to have a connected sync table of just the template parent records. all you would need is a title for the record like Project Nam and the Record ID of the original parent table. That record ID will come across as [Record ID#2], but so you don't confuse yourself rename that field to be called [Record ID# of Project Template Record]
Then make a relationship where the project template connected sync table has many project records and you will choose which template do you want to use for the copy Parent Child parent child. The lookup of [Record ID# of Project Template Record] what you would use in the Java script copy parent child formula field.}
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------