Skip 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.

Loops with a copy from one portal row and paste to another portal row

Featured Replies

Hi - I am brand new to this forum. I have been scripting off and on for a few years with FM and have just moved to FM 5.0.

I have a script where I am looping through a set of portal rows "x" number of times. The first time through the loop, the script advances through the portal rows correctly, however, on any subsequent loops, the script skips the last portal row and double copies the first portal row.

I have a counter set up to equal the number of rows in the portal and have breaks in the loop to ensure that the counter is advanced correctly.

Any ideas????

Thanks a bunch

Danny Gillespie

What exactly is the script supposed to do?

Is it duplicating info in the portal from one row to the next?

Historically, I've had mixed success looping through portal rows using the go to next portal row approach. I've also found that the concept of last portal row is sometimes a problem. What I've generally done for robustness is to keep track of the portal row number and the number of portal rows with globals and use the go to portal row number script step. I've also tested the global containing the number of portal rows against the global with the current portal row to terminate any loops. -bd

  • Author

Thanks to both of you for the replies.

The loop is supposed to loop through a particular portal (named "user") x number of times and copy the "user" portal record ID then paste it into another portal ("timesheet").

I have a counter set up that is advanced each time I perform the copy from the "user" portal and paste in the "timesheet" portal.

The loop uses the "Go to row number" script and I set the row number equal to the counter.

The issue is as follows. For example, I have 5 records in the "user" portal. The first time I loop through the "user" portal and then copy into the "timesheet" portal, I get five rows with the proper IDs (1, 2, 3, 4, 5), however, on subsequent passes through the loop I get (1, 2, 3, 4, 1).

It is about to drive me batty... Anyone else encountered this?

Thanks

DG

I've haven't had great success navigating portal rows in scripts either. Filemaker often forgets which portal row that it's on and reverts back to row 1.

A couple of other alternatives:

Rather than loop through the portal, go to the related file instead. Find the applicable records and loop through them there. Of course, this means multiple scripts and jumping between files.

Or, if your script is creating new records in your timesheet file, you may be able to accomplish the same thing by doing an import from your user file into the timesheet file.

[This message has been edited by BobWeaver (edited January 07, 2001).]

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.