Forum Discussion
MarkShnier__You
Qrew Legend
5 years agoThe best approach is to scrap that code page.
There is an API for CopyMasterDetail. https://help.quickbase.com/api-guide/understandreference.html
The User would select a Template Project which holds the correct child tasks and import them into the current record that the user is on. There is no need to use a code page.
It's a simple URL formula field. Give it a try and post back if you get stuck or contact me for some quick consulting help of about an hour.
The final formula will look something like this
var text Import = URLRoot() & "db/" & Dbid() & "?act=API_CopyMasterDetail"
& "&relfids=65" // relationship report link field to the correct child table
& "&destRID=" & [Record ID# of Template Project] // source of he children
& "&sourcerid=" & [Record ID#]; // destination of he copied children is the record we are sitting on.
var text DisplayProject = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID# of Template Project];
$Import
& "&rdr=" & URLEncode($DisplayProject);
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
There is an API for CopyMasterDetail. https://help.quickbase.com/api-guide/understandreference.html
The User would select a Template Project which holds the correct child tasks and import them into the current record that the user is on. There is no need to use a code page.
It's a simple URL formula field. Give it a try and post back if you get stuck or contact me for some quick consulting help of about an hour.
The final formula will look something like this
var text Import = URLRoot() & "db/" & Dbid() & "?act=API_CopyMasterDetail"
& "&relfids=65" // relationship report link field to the correct child table
& "&destRID=" & [Record ID# of Template Project] // source of he children
& "&sourcerid=" & [Record ID#]; // destination of he copied children is the record we are sitting on.
var text DisplayProject = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID# of Template Project];
$Import
& "&rdr=" & URLEncode($DisplayProject);
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
jrossausiscom
5 years agoQrew Assistant Captain
Hello
Thank you for this example code, I am looking at it now. To be clear, when it asks for the relationship report link field ID, what do I do if I have multiple children? In this case 4 (Well, 3 and maybe the 4th later).
Also, does this still allow me to write specific data to each child?
------------------------------
John Ross
------------------------------
Thank you for this example code, I am looking at it now. To be clear, when it asks for the relationship report link field ID, what do I do if I have multiple children? In this case 4 (Well, 3 and maybe the 4th later).
Also, does this still allow me to write specific data to each child?
------------------------------
John Ross
------------------------------
- MarkShnier__You5 years ago
Qrew Legend
The relationship report link fields for the different types of child records would be listed comma separated.
"&relfids=65,66,67"
The template records will be just copied in from the Template children. You cannot auto write to them. What do you need to write to them. Can you just have a lookup fields from the parent down to the children?
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------- jrossausiscom5 years agoQrew Assistant CaptainMark
Sorry for the delay.
Basically we have a template that let's you choose the type of work we will do. This is the staging type. Each staging type has 3 types of children, a Cost, Financial, and Config. Note that there can be multiple of each of those 3. How our old system is setup and running currently, we have a button that makes fresh copy of the related (related by the Staging Type) Costs, Financials, and Configs. Those fresh copies are then related to the request and job and unrelated to the Staging Type.
Basically the goal was for the Staging Type to only ever show it's "template" children, and for each request and job to have their own "live" costs, financials, and configs that are only related to said request and job.
------------------------------
John Ross
------------------------------- MarkShnier__You5 years ago
Qrew Legend
... I see you last comment, but was there a question in there? Did you try what I suggested?
But I see that I had he source and destination reversed.
var text Import = URLRoot() & "db/" & Dbid() & "?act=API_CopyMasterDetail"
& "&relfids=65" // relationship report link field to the correct child table
& "&destRID=" & [Record ID#] // source of he children
& "&sourcerid=" & Record ID# of Template Project]; // destination of he copied children is the record we are sitting on.
var text DisplayProject = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID# of Template Project];
$Import
& "&rdr=" & URLEncode($DisplayProject);
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- jrossausiscom5 years agoQrew Assistant CaptainHey again Mark
The children need to have the request and job record ID's to them to related them to said request and jobs.
------------------------------
John Ross
------------------------------- MarkShnier__You5 years ago
Qrew Legend
I think this would take some one on one assistance to be able to see the app to fully understand what that old code was doing and what functionality do you want now or what functionality you're trying to replicate. If you have a small budget, feel free to contact me at the email address below for one on one assistance.
I typically do not charge for a short call if I determine on the call that I cannot help you.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------