Skip to main content
Question

Copy Master and SELECT child records

  • December 26, 2023
  • 0 replies
  • 180 views

MarkStrassel
Forum|alt.badge.img+5

Hello,

I am trying to use the Copy Master Record button but I would like to be able to only copy select child records based on a field within the child records.  As an example, Copy a project and only copy task records that are not marked as completed.  This would not have to use the copyMaster function specifically if there is an easier way via pipeline etc.



------------------------------
Mark Strassel
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+9

You could use CopyMasterDetail if you wanted by modifying the report link field(s) that you're referencing. The idea behind a normal report link is that it's matching Value from Parent to Value in Child. So in most relationship that is matching the [Record ID#] of your parent to the Related Parent field in your child. 

You could make a new field though that is something like [Conditional Parent] that is an IF statement like: 

if( Status != Completed, [Related Parent], null)

Then make a new report link that matches Record ID# from Parent to [Conditional Parent] value in child. Use that as your CopyMasterDetail relfid. The idea is that you're conditionally selecting which records you want copied in the report link 



------------------------------
Chayce Duncan
------------------------------

Forum|alt.badge.img+2

Hi Mark,

  very simple to do with Pipelines.  I like to use a formula url field that displays as a button to edit the record to fire the pipeline, it also helps you track who copied the project...
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid="& [Record ID#]
& "&_fid_112=Copy Project Clicked by " & UserToName([Last Modified By]) & "_" &ToText((Now())) 
& "&apptoken=**use your own APPLICATION TOKEN here**"
& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid()& "?a=doredirect&z="&Rurl())

Pipeline Steps:

  1. Create a Pipeline that triggers when a Project record is updated and field_112 is updated
  2. Create a new Project Record
  3. Search Tasks table records from the Updated Project where Related Project = Record id of updated project and Status is not Completed
  4. loop through those task records found in step 3
  5. create a new task record for each task found, set Related Project = Record ID of Project record created in step 2



------------------------------
Juiced Technologies
------------------------------