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.

Problem with global Total Record Count.

Featured Replies

I would pull my hair out but little remains from some of my other FM battle scars...

I need to have field in each table that stores as a global value the current record count of that table. This is referenced in a number of ways throughout the project.

I have been using the function Get(TotalRecordCount) in a global calculation field. The problem is that although it updates when a record is added, it does NOT update when one is deleted. Why is this?

My other attempt was to include a script step that used set field and set a value with Get ( TotalRecordCount ) to the global field nthis works very well. Since I am using a set of custom scripts for record creation and deletion anyway this is good, it updates instantly and works for deletion and creation but it has a quirk...

At the bottom of each record I have a merge field that concatenates a statement, "Record " @@ " of " <> but the @@ does not show the correct number. In other words I delete a record and there are 44 records I never see "Record 44 of 44" Now why is this?

I would like to know what is wrong with either approach and if should do something else instead or modify some part of these methods? Thanks so much.

Edited by Guest

Your field should just be a standard, unstored calculation, not a global.

  • Author

Bruce, but is this not a an issue in the sense that I do not need to have this field have a value for every record?

Since this is a global value would not want to put it in a global field?

No, it is not an issue. Your field should just be a standard, unstored calculation, not a global. What happened when you actually tried this?

  • Author

I don't know if this is recommended but I went with the global field and the update via a the script script with a deletion and creation script. What I added to the deletion script was an unspecified sort after the delete record script step, this forces an update of the current record number.

If someone has the time I would still like to know more about the questions above and if this method I am using now is ok or a future gotcha.

Hi Garrett

The main problem with the method you are using is that someone, even you, may create or delete a record without using your script and then your global field may not be updated. There is also a possibility that records will be deleted via a relationship and again the global will not generally be updated. This is not a problem, as Bruce has pointed out a couple of times, if you use an unstored calculation field. The amount of storage space used by such a field is, as it says, minimal and it refreshes every time it is required to be viewed on a layout. It also reacts to the number of records no matter how the number is changed. If you intend to put record counts on your layouts this is definitely the way to do it.

I have not come across any problem using @@ to show the record number (except when I have not left enough space to show the number!)

Get over it. Just use an unstored calculation. It is an absolutely standard technique used in zillions of files and you are just creating problems for yourself by avoiding it.

Hi Bruce,

You can lead a horse to water, but it isn't your fault if they just wallow in the mud.

Lee

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.