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.

loop is skipping records on occasion.

Featured Replies

ok i have this script, what it does it loop through all the records in a relationship (Orders_) and e-mails someone the Order ID Number. then it stores the Order ID Number the "hold" field, so it know that the record has already been e-mailed. NumofPortalRows is just a field that tells me home many portal rows there are. gPortalNumber is a global that keeps track of what portal row i am on. Now the script works most of the time. However, sometimes the script will skip a record. Its totally random when it does it, sometimes it will skip the first record, sometimes one in the middle. Most of the time it won't skip a record at all. If it does skip a record i can run through the script again and it will pick that record up and e-mail it. So, my question is, do you see any problems in my script that would be causing it to randomly skip a record.

code:


If[ NumofPortalRows = 0 ]

Exit Script

End If

Set Field [ gPortalNumber, 1 ]

Loop

If

[ PatternCount(hold,Orders_
???
:Order ID Number) < 1 ]

Set Field [ hold, hold &Orders_:Order ID Number& "

The problem could lie in the line

Go to Portal Row [ Next, Select entire contents, Exit after last ]

I have recently had many problems with this due to the fact that if the focus is lost from the portal (possibly when you set a field or send mail) then when this command is executed the portal goes back to row 1.

Try using

Go to Portal Row[ gPortalNumber ]

[ By Field Value..., Select entire contents ]

instead. Since you have the global field there anyway you might as well use it to its full potential. To exit the loop you can use a comparison with Status(NumPortalRecords) (or whatever that command is) and the number in your gNumberPortal field.

Hope this help smile.gif" border="0

  • Author

you know what, i had that before(in fact that was the whole reason i created the global field), and for some reason i took it out. i forget why i did it. i really don't even remember taking it out.. well anyway, here is my edited script.

code:


If[ NumofPortalRows = 0 ]

Exit Script

End If

Set Field [ gPortalNumber, 1 ]

Loop

If[ PatternCount(hold,Orders_
???
:Order ID Number) < 1 ]

Set Field [ hold, hold &Orders_
???
:Order ID Number& "
  • Author

ok, even with my new and improved script it still skip a record sometimes. I know that a more practical solution would be to actually run a script from the related database, but unfortunately that is not possible in this situation, i can't really explain why. but, needless to say, i need it working through the portal. Any more ideas?

In the If Statement...possibly move the "Go To Portal Row" command above the "Set Field" command.

You might have a reason for doing it the other way around but at a quick glance it seems odd.

Hope this helps

  • Author

thanks, now that you mention it, it does look a little odd. well, i guess we will see how this works.

On skipping records in a loop --

I've had this same problem...then I found an obscure article somewhere that mentions that you need to first go to the last record and move backward ["go to previous record, exit after last" I think] in your loop script to avoid skipping records. Since trying this, I haven't had this problem anymore.

The looping backward technique is for a different problem. It avoids the skipping of records if you have an omit or delete step in your loop.

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.