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.

Can a field count how many records in a portal?

Featured Replies

I have a number of records appearing in a portal. I need to have the computer tell me how many records are in that portal. How can I do that?

Thank you!

Define an unstored calculation field with a number result as:

= Count(YourRelationship::AnyRelatedField)

-bd

  • Author

So cool. Thank you very much! Works great.

Hi Wes,

Not to correct, but to clarify:

quote:

Originally posted by LiveOak:

Define an unstored calculation field with a number result as:

= Count(YourRelationship::AnyRelatedField)

-bd

Make sure that "AnyRelatedField" is any field that is non-null / not empty. Best practice is to always use the target key field, because you know by default that it is not empty (since it shows up in the portal).

Good luck

  • Author

Thank you Andrew. A follow-up question...

It is very likely that I will always start out with "AnyRelatedField" being Null or Empty. How can I make "Null or Empty" sequal ZERO?

For instance right now I'm adding a Payments file that interfaces with my Invoices file. When I create a new invoice, there isn't a payment attached yet, so there are no records in the payments file for that invoice. I have a field in the invoice for Total Remaining which is the ([total due] - [payments received]). Payments Received is a SUM of all the payment amount fields in the portal.

I would like this sum to start out at Zero, but for now it starts out BLANK because there are no related records in the payment file.

Thanks.

First, use a Constant field as you target for the relationship.

Constant(calculation, number, indexed) = 1

Second, format your sum field to show blanks as zero.

-bd

Wes

If the record is related, the match field *must* have a value in it -- it cannot be null or empty because it wouldn't be related to anything if it was.

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.