Jump to content

script to copy and paste repeating field


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

Recommended Posts

  • Newbies

I'm new to this, so thanks for any help you can give me. I'm trying to create a script that copies ALL the contents of a repeating field and pastes it into another repeating field. It seems like it would be easy, but for some reason I can't seem to copy ALL the contents. I can copy the data in the first line, or I can specify the script to copy a specific line of the repeating field, but I can't copy everything. Unfortunately, each record has a varying amount of data in the repeating field (i.e., one record might not have anything in the repeating field, and another record might have 10 lines in the repeating field.) I can tell that the repeating fields are going to be a problem, but until I can redesign the database, I need to find a way to do this.

Thanks again for any help.

Link to comment
Share on other sites

quote:

Originally posted by peggy:

I'm new to this, so thanks for any help you can give me. I'm trying to create a script that copies ALL the contents of a repeating field and pastes it into another repeating field. It seems like it would be easy, but for some reason I can't seem to copy ALL the contents. I can copy the data in the first line, or I can specify the script to copy a specific line of the repeating field, but I can't copy everything. Unfortunately, each record has a varying amount of data in the repeating field (i.e., one record might not have anything in the repeating field, and another record might have 10 lines in the repeating field.) I can tell that the repeating fields are going to be a problem, but until I can redesign the database, I need to find a way to do this.

Thanks again for any help.

Copying each one individually is the only way. There is no "copy all" function for repeating fields.

When you redesign make sure the evaluate why you use the repeating fields, you might be much better off using related files.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Consultant

Database Resources

mailto:[email protected]

http://www.database-resources.com

=-=-=-=-=-=-=-=-=-=-=-=-=

Link to comment
Share on other sites

While you may not be able to do everything you want with FileMaker, you might try this to cut down on the amount you have to do.

Create a layout with just the repeating field you want to copy and all of the repetitions for that field. Don't put anything else on the layout. Use the Copy All command to copy all the information from that layout.

I haven't tried it, but this might place a tab deliminated string with the contents of each repetition between the tabs. Then you would need to parse this data so that you can set the data in the fields where you want it, but at least you didn't have to use the Copy command more than once.

Chuck

Link to comment
Share on other sites

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