Jump to content

Duplicate Multiple Records?

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

Recommended Posts

File 'A' has record that I need to duplicate and change a few field values for each record. I have a script in Field 'B' that initiates the script.

- Goto Related Records (File A)

- Perform Ext. Script (File A -> Duplicate Records)

........- Goto Record (First)

........- Loop

.............- Duplicate Record

.............- Set Field 1 = ""

.............- Set Field 2 = ""

.............- Set Field 3 = File C::Global_Value

.............- Goto Record (Next, exit after last)

........- End loop

It will only duplicate the first record in the relationship, and then stop. Any ideas? Thanks! : )

Link to comment
Share on other sites

When your records aren't sorted, and you duplicate a record, you'll then be on the duplicated record, which will be the last record. So going to the next record will exit the loop.

There are various methods to deal with this: you can start with the last record and use a couple of omits after duplicating, or what probably will work for your existing script, just sort the records before your loop, in which case the duplicated record will follow the record you started with. Note that sorting will automatically put you on the first record, so you can get rid of the Go to first record step.

Link to comment
Share on other sites

Hi, thanks for the quick reply. I'm not too familiar with sorts, but I had tried yesterday what you said and it worked fine.

However, when I tried it today, I get an error because it cannot restore the sort. I thought, from my reading, that the sort that is currently active when you create the script will be stored along with the script (so you can use the no dialog function). But apparently my script did not?

I guess this is getting into another area from my original topic, but how do I create the script and sort so that I can have it work every time with no dialog??? Thanks

Link to comment
Share on other sites

This topic is 7574 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.