Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Can a field count how many records in a portal?


This topic is 8421 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!

Posted

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

Posted

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.

Posted

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

Posted

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.

This topic is 8421 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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