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.

How to script to select the next value in a generated value list?

Featured Replies

  • Newbies

I am working in FMP 5 and need to create a script to Find records of all jobs, which have 5 or more separate records -- e.g., 00-1234 has 6 records, 00-0123 has only 2 records.

I can create a value list from the Job Number field, but I am stuck as to how to select the first value, perform a Find, check status, set flag for the Find and then go on to the next value in the value list.

Any help will be appreciated. I searched the ScriptMaker forum, but did not find exactly what I am facing.

TIA

You say that job A has five records and job B has 2 records. Are jobs kept in one database and the records that jobs have kept in another database? If so, you can use the Count function to find out how many related records there are for a job. Count the Job ID field in the database with job records, and you'll get a number of records for a job.

Chuck

If all records are in the same database, you can build a self relationship with JobID matching JobID. Call this relationship "Self by Job". Then create a calculated field:

Job Count (calculation,number) =

Count(Self by Job::JobID)

Perform a find entering ">=5" into the Job Count field. This will be somewhat slow for a large file (it's an unindexed find because of the relationship) but should still be faster than a looping script. -bd

  • Author
  • Newbies

Thank you. Works perfectly.

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.