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.

Get (TotalRecordCount)

Featured Replies

Hey guys/gals, my situation is that I'm working with 2 files (file "1" and file "2". From file "1", I want to call on a field in file "2" which is auto-enter-serial and get the (TotalRecord Count). In file "1" I have a global called "grecord_counter" which I would like to set to the total records the of file "2". Then I have a field in file "1" to display the TotalRecordCount. I hope I didn't confuse you guys. Can someone show me how to set this up and possibly show my what I'm doing wrong? It seems so basic, but it's just not working out like I had planned. As it is set right now, the script steps I have read like this:

Set Field[importer::grecord_counter; Categories::guidCategory = Get (TotalRecordCount)]

Set Field[importer::total_record_field1; importer::grecord_counter

*Categories is file "2" and importer is file "1"*

Thanks in advance.

J

You may be making it harder than it needs to be. It may work better to use a cartesian join relationship to link the two files and count the records in file 2 through that relationship:

Try adding a table occurence of file 2's table in the relationship graph of file 1. Then relate this to file 1's table occurrence with a cartesian join operator (that's the big "X" instead of the "="). Through this relationship, you can show the count of all the records in file 2 by using a Count() function over the relationship: Count(file 2::RecordID).

*Categories is file "2" and importer is file "1"*
Why didn't you just use their real names in the first place??

If you have hundreds of thousands of records in that Categories file, or you're running over a slow network and this count will be used on layouts, then a scripted approach may make sense. In that case you can do what you were trying by switching the layout to one based on the correct table occurence:

# within the Importer file

Go to Layout [ Some Categories layout ]

Set Field[importer::grecord_counter; Categories::guidCategory = Get (TotalRecordCount)]

Go to Layout [ original layout ]

This means you would need to have a Categories table occurence in the Importer file and use that as a basis for a layout that this script would run in. Or you could put that Set Field[] in a subscript within the Categories file, and call it externally.

  • Author

now every time I try to get the total amount of records, all i get is "0" when there are really "22". all my fields and contexts are correct as I've been over them 100 times. Any ideas?

J

Your SetField looks a bit odd.

Set Field[importer::grecord_counter; Categories::guidCategory = Get (TotalRecordCount)]

The only possible results of the calculation are 1 if Categories::guidCategory = Get(TotalRecordCount) and 0 otherwise.

I can't believe this is what you want so what are you trying to do here or is there a copying error.

Missed that one.

It should be:

# from a layout in Categories

Set Field[importer::grecord_counter; Get (TotalRecordCount)]

  • Author

Yeah, I just got it working. Finally!! Thanks guys for all your help!

J

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.