October 31, 200124 yr 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!
November 1, 200124 yr Define an unstored calculation field with a number result as: = Count(YourRelationship::AnyRelatedField) -bd
November 2, 200124 yr 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
November 2, 200124 yr 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.
November 4, 200124 yr 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
November 4, 200124 yr 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