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.

Featured Replies

I know there is a function in filemaker to generate a random number.

Has anyone successfully applied this to make a script to go to a random record?

All our records obviously have an id in the format II#xxxxxx where x is an updating serial number.

Any ideas?

Thanks

I think this will work:

Set Field [ gRandomTemp , Round(Status(CurrentRecordCount) * Random, 0) ]

Go to Record/Request/Page [ gRandomTemp ]

If you have a copy of "Scriptology" there is a file called RandomPicks.fp3, on the companion CD, which chooses random records using a different technique.

  • 2 weeks later...
  • Author

Yep just tried it - sorry for my late reply

Works great!

Thanks

There's a slight flaw in Ender's formula which will give a skewed distribution. The last record will only have half the chance of being picked that the other records have. Also, there is a chance the formula will return a zero value, and there is no corresponding record zero. To give a fair distribution, the round function should be replaced with Int as follows:

Set Field [ gRandomTemp , Int(Status(CurrentRecordCount) * Random)+1 ]

Go to Record/Request/Page [ gRandomTemp ]

  • Author

Ah right OK - excellent thanks!!

Not that it really matters with 80,000+ records!

Thanks

I try to leave a bug or two in my answers as an exercise for the reader. wink.gif

Do you work for Micro$oft?

Hi, folks! IMO BobWeaver is among the top experts at FMFORUMS and personally, I am glad for his input and corrections -- and especially his explanations when he is generous enough to provide them. He's one of the reasons FMFORUMS is so helpful to so many of us. I can think of many scenarios where not having a truly random (ha! truly random!) solution could be problematic and raise issues of liability. What if FMFORUMS randomized the ad banners w/an inaccurate function and an unhappy customer wondered why his/her banner was not showing up as much as other advertisers? Uh.. ooopss.. sorry, Stephen, maybe we shouldn't go there, eh?

Anyway, you get my point, eh? So, thanx, Bob! Keep us honest and keep FMFORUMS creditable!

--ST

Absolutely!

Create an account or sign in to comment

Important Information

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

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.