October 29, 200322 yr 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! : )
October 29, 200322 yr 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.
October 30, 200322 yr Author 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
October 30, 200322 yr Author Ahhhhh, nevermind, I'm an idiot. I did not have the 'restore sort' option checked. Thanks for the help though, it worked great!
Create an account or sign in to comment