Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Copy Multiple Records

Featured Replies

I'm trying to write a script that searches for records that match a certain criteria (that's done) Then I want to make a copy of each of those records and change one or two values. I thought I could do this with a loop, but my loop just keeps copying the first record over and over, even though my script says:


Go To First Record

LOOP

   Duplicate Record

   Go To Next Record

   Exit when hit last record from original search (done with variable)

End Loop

Why does this keep copying the first record instead of going to the next record and eventually stopping?

Its not copying the first record. If is making a copy of the copy. So it looks the same but it isnt.

Also you dont need to do this with a variable. You can use go to record [next]. There is an option to exit the loop after the last record.

To keep your orig found set, try opening a new window to duplicate the record and then close the window right after. Your orig window will keep your orig found set. Therefore, you can go to the next record to duplicate.

Try this script

Go to Layout [ “Layout #1” ]

Loop

Duplicate Record/Request

Omit Record

Go to Record/Request/Page

[ First ]

Omit Record

Exit Loop If [ Get ( FoundCount ) = 0 ]

End Loop

John's suggestion (use a new window for the duplicating) and Lee's example (omit as you go - also possible to do in a new window if you want to keep your found set) are both good methods.

I think part of your problem is that FileMaker's Duplicate command behaves differently depending on whether your found set is sorted or not. When it's sorted, the dupe will follow the original, so you can then go to the next record. But when the records aren't sorted, the dupe drops to the bottom of the list. That's where the Exit After Last option would have rescued you.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.