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

Duplicate Found Set, change one field in new records?


davidjahns
 Share

Recommended Posts

I'm trying to duplicate a set of related records (tape line items) from one record (tape) to another.

 

I'm trying to accomplish this by writing a script to go to related line items, duplicate all of them, and then change the field that links back to the root level.

 

Let's say I had 6 line items on Tape #100, and want to copy all items to Tape #101.

 

Go to Line Items Layout, Related Records, Found Set = 6. Good so far!

 

I had hoped to Duplicate All Records, thereby having 12, and changing the 6 new records to Tape Num 101.

 

I had hoped to be able to tell FMP to go to record #7 (first new one), change Tape Num to 101 (Global Temp Storage field), Go to Next, Repeat, exit after last.

 

The problem I'm having is in the Duplicate All Records (in Found Set) step. I tried to say: Loop / Duplicate Rec / Goto Next, exit after last / End Loop - but the problem is that after Duplicating the Record, the new one becomes the active record, and it is the last record in the found set, so only the first one gets duplicated.

 

Is there a way to Duplicate all 6 records?

 

Is COPY ALL RECORDS something I should be using? How does that info get pasted into new records?

 

Thanks for any help...

Link to comment
Share on other sites

Figured in out, if anyone is looking to do the same thing.

 

The key is to OMIT the original record within the loop, and EXIT the loop when you've changed all of the new records.

 

Go to 1st

Loop

Dup Rec

Set Field = Target: New Value

Go to 1st

OMIT REC

Exit Loop If Target = new Value

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use