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
------------------------------
- LoranPrince12 months agoQrew MemberHey good morning Mark, Thanks so much for your help. I know you are the most knowledgeable guy there!!!!
I used to come to your big events when you had them live.
The button works, however. You are correct about the templates being on the same table.The code they way I set it up does copy the child records and the grandchild records.the code is"javascript:void(copyMasterDetailButtonHandler('&relfids=33&sourceRID=57&destrid=" & [Contact info ID#] & "', 'bt37k7pc8'))"
I think 57 refers to the job that the tasks are copied from.
I would like to have the code refer to a differing job based upon a choice made on the form thereby choosing which template to copy.
How would I set that up to make that choice and show the RID for the differing job to copy from? I can see that a loop may be formed.
There is a way I think but how without the loop?
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