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.

Set Field to next consecutive number

Featured Replies

I'm trying to write a script that will change the number in a field to the next consecutive number. I would like it do do it to a found set of records. So, i created a script with a loop. It works when the number is "1" - it will change to "2". However the next time i run the script it stays at "2" - it doesnt' change to "3". It also skips the last record because i couldn't figure out how to make it do the last record and then stop. Anyway, here's what I have:

Loop

Set Field ["A", "Count(A) +1"]

Go to Record/Request (Next)

Exit Loop If [status(CurrentFoundCount)=Status(CurrentRecordNumber)

End Loop

Alkmost there...

Set Field ["A", "A+1"]

Try this script instead:

Create a global field called "gCounter"

Set Field ["gCounter", "0"]

Loop

Set Field ["gCounter", "gCounter+1"]

Set Field ["A", "gCounter"]

Go to Record/Request (Next, Exit After Last)

End Loop

  • Author

thanks guys smile.gif" border="0 I used the A+1 and checked the Exit after last. Didn't have to do the counter on this - don't think i need to but will keep in mind for future if this other doesn't work out for some reason.

Thanks smile.gif" border="0

Instead of the loop and Set Field [], you could replace the whole lot with a simgle Replace [] step...

Replace [by calculation, "A = A+1"]

I've written the step in pseudo English to give you the idea. Just make sure that the appropriate set of records is found before the Replace[] step is peformed.

Here's an idea: do both scripts and time which is faster. Let us know the result.

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.