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.

next record in date order

Featured Replies

I have a DB of events. I would like to create a script that will take the user to the next event. Given that the records may not be in date order, the script obviously must sort first, but a simple, "sort -> next record" always results in displaying the second record. How can I create a script that will simply take the user to the record with the next sequential event date?

Before you sort you need to store which record you are currently on (using a serial number or some other unique identifier) into a global field, then sort, then use a looping script to return to the original record again THEN go to the next record.

Set Field [gRecordID, RecordID]

Sort

Go to Record [First]

Loop

Exit Loop If [RecordID = gRecordID]

Go to Record [Next]

End Loop

Go to Record [Next]

The "Go to Record [First]" step is probably redundant since after sorting the first record is usually selected, but I like being defensive.

This simple script could be made a lot more elaborate, but this will suffice. (It does not, for instance, have any code to elegantly handle the situation where there is no record after the original record; and there is no way to break out of the loop in the unlikely event that a RecordID does not match the global.)

If you want to avoid the loop, just store the unique identifier in a global field, create a self-join from the global to the field that contains the unique identifier, and use the Go To Related Record script step. Then go to next record.

  • Author

Both those suggestions are great, except I've thrown another factor into the script. I have 3 "DAY TYPES"; show day, travel day and day off. I only want the script to show me "show days" so now the script starts like...

Set Field [gEvent ID, Event ID]

Enter Find Mode [ ]

Insert Test [select, "Day Type", "Show Day"]

Perform Find

Sort

Neither suggestion will work if the current record is NOT a "Show Day"

Looks like you almost have it. You could do this:

with a global date field, gDate...

Set Field [gDate, Date]

Enter Find Mode

Insert Calculated Result [">" & DateToText(gDate)]

Set Field [Day Type, "Show Day"]

Perform Find

Sort (by date)

Now your next show day is at the top of the list, and you're on it.

Another idea is to create 3 self relations based on the day type.

Then have the portal sort by date, then use the go to portal row [next] and go to related record[] combo.

Thats should do it. But other idea here are better tho.

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.