Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6550 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello,

i was wondering if someone can help me with this. let say i have 20 records which i want to duplicate all at once. is there a way to do this using script?. i am using FM 6.0.

any help would be appreciate it.

thank you

victor

Posted

I find the easiest way of doing this is using a script to export the records, as an .fp# file, and then re-importing the data.

There are numerous other ways but I find this to be the simplest.

Regards

Orlando

  • 2 weeks later...
  • Newbies
Posted (edited)

I have to do a simimlar thing in a solution where I duplicate a set of around 10 records max. Rather than export/import i use a loop.

I cannot paste the exact code right now but the premise is very simple, heres some psuedocode

Go to found set of records you wish to duplicate.

Set $counter to 1

Set $numRecords to get ( foundcount )

Go to first record

Loop

Go to record [ counter ]

Duplicate record

Omit record

Set counter to itself + 1

Exit loop if $counter > $numRecords

End Loop

Bit messy, but duplicating a record adds it to the found set and takes you to that last record in the found set, so you need to keep track of where you were in the original found set and go back to that record + 1. You omit the duplicate to maintain the size of the original found count (altho this may not be necessary but I do it anyways).

The reason I do this instead of export/import is if possible, I prefer to keep everything within the database and not have to export things to hard disk as if it is done without prompt there may be problems if paths become nonexistent, change etc.

Edited by Guest

This topic is 6550 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.