Forum Discussion

ArchiveUser's avatar
ArchiveUser
Qrew Captain
9 years ago

How can I add to a Copy Master Detail button to relate the children being added to a related field in the parent record from another table?

I have two tables, Budgets (parent) and Schedules (child). In the Schedule table I have a Copy Master Detail button that copies tasks into the Schedules table. This works perfectly:
"javascript:void(copyMasterDetailButtonHandler('&relfids=60&recurse=false&sourceRID=63&destrid=" & [Record ID#] & "', 'bmkrwxh6s'))" and relates fine to the related Schedule

What I want to know is if I can add to that url and have the Task child records also relate to the Related Budget ID of the Schedule (fid_44) so the Tasks relate to the Schedules' related Budget as well. How would I write this in the formula?

Thanks much!
Dawn
  • While there is a way to do what you are doing, i don't believe it is a simple addition to the formula. 

    A separate way of solving this problem may be to send the 'related budget' field down to the tasks table as a lookup field. It would be renamed something like: 'Schedules - Related Budget'. With that, we are now telling the tasks which budget they relate to through the schedules table. From here you can create a report link on the budgets table that looks at the tasks table and matches records where the record id# on the budget table is equal to the value in the new 'Schedules - Related Budget' field. This would allow you to see all the tasks for all the schedules related to that budget when looking at the budget record. 

    For some folks, that would be enough. Another thing you could do - if you really need to relate those tables for some reason - is to build your relationship between budgets and tasks and change the related budget reference field on the task to a formula numeric field that points to the lookup field that you created 'Schedules - Related Budget'. That would provide a true connection and automatically link every task to a budget as long as it is also linked to a schedule that is linked to a budget. 

    Let me know if you need any clarification on this - or if you would rather skip all this and go the code route you can reach out to me at my contact info in my profile for further discussion.

    Good luck!