Jump to content

Can a field count how many records in a portal?


wplate
 Share

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

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 7289 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
 Share

×
×
  • Create New...

Important Information

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