Jump to content
Salesforce and other SMB Solutions are coming soon. ×

I want to Duplicate a Record and all its Children


The Digital Man

Recommended Posts

O.K. I want to know what is the best way to duplicate a record and all its children. I was going to set up a loop and loop through the children creating a new child record for each one but then I thought surely there must be a better way.

 

JOBS is my main record database.

COMPONENTS is my children record database.

 

So say the user is on JOB #349 (the ID is 349) and this particular job has 6 COMPONENT records associated with it. COMPONENTS ID will be say 401-406. COMPONENTS JOBID of course will all be 349. The user pushes the DUPLICATE JOB button.

 

I've scripted a SET FIELD where I store the JOB ID (i.e. 349) into a global field.

Then I've scripted a DUPLICATE RECORD/REQUEST which produces another JOB record.

I've then stored that JOB ID into another global field.

Now I'm ready to duplicate the 6 children records so I scripted a GOTO COMPONENTS LAYOUT step.

 

What do I do next? I'm on a layout where the 6 children records are being shown.

 

Thanks for the help.

Link to comment
Share on other sites

Thank you so much aaa.

 

I figured looping was probably the way I had to go but wasn't sure how to code it. Your example was MOST helpful and appreciated. I also thought that maybe the folks at Filemaker had made some cool new command that would just duplicate a whole brood of children for a record. I guess that will be for a later upgrade. Although I am not looking forward to another one anytime soon. I'm struggling to wrap my head around this last one.

 

I added one statement immediately following the duplicate step where I changed the JOBID to the NEW JOBID that I had stored in my global variable. That way all the new children belong to the new JOB record. It works like a charm! smile.gif

 

Thanks again.

Link to comment
Share on other sites

"I added one statement immediately following the duplicate step where I changed the JOBID to the NEW JOBID that I had stored in my global variable".

When i posted script i was sure that you can do it.

Link to comment
Share on other sites

I added one statement immediately following the duplicate step where I changed the JOBID to the NEW JOBID that I had stored in my global variable.

When i posted script i was sure that you can do it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

Terms of Use