Jump to content
Sign in to follow this  

count of ALL related records, not just those in portal

Recommended Posts

I have a series of related databases: Trips, Parties, Clients. A trip contains parties, which contains clients. From the perspective of Trips I want the number of total clients in that trip.

I have two portals set up in my layout. One shows the parties related to a trip. When I click on a button in a portal row of the parties db, then the clients in that party are displayed in a second portal.

When I click on a button in the portal row of the clients db, then additional detail about that client is displayed in fields next to the portal.

This all swell and is working perfectly.


I have a calculated field in the Trips db that counts the clients in the related clients db. However this is only showing the count of related records in my portal, but I need a record that holds the total of all related child records regardless of whether the are contained in a portal or found set.

This is probably stupid simple, any help appreciated.

Share this post

Link to post
Share on other sites

Since the count() function returns a result of all records whether or not they appear in a portal I can only presume that if there are more related records then you have in your portal then there must be 2 relationships - 1 for the portal, and 1 for all the related records.

If that is the case then when you formulate your Count() calc use the relationship that relates to all the records and not just those within the portal.

Or am I missing something?


Share this post

Link to post
Share on other sites

I thought that count() would return all related records whether in the portal or no but that's not what was happening.

When I clicked on a button in the Parties portal row it set the value of a global field to the value of that Party record ID.

Then only the client records that matched that ID were displayed in the second portal via a relationship with set up with that global field.

In any case I solved the issue by setting up some new table instances and created the needed chain of relationships down to the client table. The first chain was being filtered by the table row button but the second relationship chain was unfiltered and so always reported the correct number of clients in the party.

There may be another way to do this but this options works fine.

Thanks for the input.


Share this post

Link to post
Share on other sites

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

Sign in to follow this  


Important Information

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