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.

Number of records in a specified table

Featured Replies

I require a way to formulate the number of records in a specified table. I've looked through the function list but to no avail. 'Get' functions have no parameters and so can only display the number of records in the current table which is useless as I want to use this as part of a trigger for a script. Alternatively something that triggers when a new record is created in a specified table would do. I find it hard to believe that something so simple doesn't exist and am consequentially betting that the function exists under a confusing title. So, does anyone know what it is? I suppose if the worst comes to it, I could make a custom formula that lists all record UIDs from a table and counts them but I'd rather not if a function already exists...

Unfortunately the function Get ( TotalRecordCount ) or Get ( FoundCount ) is context sensitive requiring you to be on a layout for the table in question. Therefore your script would require you to switch layouts to get that value.

You could open layouts "off screen" by declaring a negative value of say -5000 top, go to layout grab value in variable then close that window.

Alternatively with a plugin that does SQL queries you could also grab this info without switching context.

I had discovered this same seemingly simple task - and ended up using AppleScript to get the record counts.

How about a Cartesian join and a Count(table::pk)?

  • Author

You could open layouts "off screen" by declaring a negative value of say -5000 top, go to layout grab value in variable then close that window.

Good idea but possibly too complex for me. It will be easier (although less elegant/robust) to do what my Uncle suggested (I e-mailed him as well as posting here) and control the way the new record is made with a script invoked by a button,

rather than using the native 'New Record' application command. The button could then also run the script I want. I was thinking of building a kisok friendly/custom button driven system anyway. I appreciate the quick reply and I hope this thread may be useful to people in the future!

1. Create a field in the tables you want to count that is unstored get(RecordNumber) - I use zcRecordCurrentNumber

2. Create a relationship from the Table Occurrance you want the count from that includes all records

3. For each table (or you could combine) use the calc Last ( Relatedtable::zcRecordCurrentNumber )

That's it.

Cheers

Tim

  • 3 weeks later...
  • Author

1. Create a field in the tables you want to count that is unstored get(RecordNumber) - I use zcRecordCurrentNumber

2. Create a relationship from the Table Occurrance you want the count from that includes all records

3. For each table (or you could combine) use the calc Last ( Relatedtable::zcRecordCurrentNumber )

That's it.

Cheers

Tim

Just to say that I ended up using this method for another reason and it worked perfectly - thanks Tim!

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.