Copy Master Detail from TEMPLATE PROJECT and TEMPLATE TASK to PROJECT and TASK tables.

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
I used the new UI to create a copy master/detail button between my PROJECTS and TASKS tables and it works fine (see below).



"javascript:void(copyMasterDetailButtonHandler('&relfids=35\n&sourceRID=" & ToText([Project Type ID]) & "&destrid=" & [Project ID#] & "', 'bmeh835fq'))"

I would like to now move the template projects and tasks to two separate tables (take them out of the live project and task tables), called TEMPLATE PROJECTS and TEMPLATE TASKS.  The master detail copy would need to copy TEMPLATE PROJECT and TEMPLATE TASKS to the existing PROJECTS and TASKS tables.

I looked but could not fine any clear examples on how to modify the script to accomplish this.  The template tables are set up and the relationship RELATED TEMPLATE PROJECT exists in the TEMPLATE TASKS table.

Thanks, Ron
Photo of Ron

Ron

  • 50 Points

Posted 2 years ago

  • 0
  • 1
Photo of David

David

  • 598 Points 500 badge 2x thumb
Doesn't sound possible. What if you add a field to the projects table too? I use a flag field to ID my template records.
Photo of Ron

Ron

  • 50 Points
I do that also, but then I need to enforce security so certain roles cannot access the templates.  All project and task reports also need to be filtered to remove the templates from live transactions.  And conditional form rules are required to remove 'template' fields not visible to normal users.  I was looking for a 'cleaner' solution.

Ron
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,166 Points 50k badge 2x thumb
Ron, I agree with David.  The API version of the Copy Master Detail, does not allow a table to table type copy.  When you think about it, how could it, as it would need to know the field mapping form one table to another?  Most developers just make a permission Role such that regular users may not edit the template.

However, If you wanted to go through the hoops, it can be done another way using the RunImport API, but there is extra setup required to make that work.
Photo of Ron

Ron

  • 50 Points
Mark, I sent you an email.  Would you mind giving me a call so we can discuss this further?
Thanks, Ron
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,166 Points 50k badge 2x thumb
.. just to sort of close this off for the Forum, I spoke to Ron off line and while i would have had a solution for him using API_RunImport, he showstopper was that his tasks have Predecessors and WorkDates, so I was not able to find an alternative.