4 Replies Latest reply on Dec 12, 2015 4:21 AM by AndrewJudd

    Portal Count?

    AndrewJudd

      Hi all, surely a simply one... but how do I have a field on a layout with a portal to line items that provides a calculated count of how many records (contacts) are added to a portal list.

       

      I'm using a portal to make lists as guest lists. It would be good to have an automatic count of how many people are on a list. Here is the popover script I'm using..

       

      I imagine I need a SUM calculation but it's just implementing it.

       

      Thanks

       

      Screen Shot 2015-12-11 at 16.13.08.png

        • 1. Re: Portal Count?
          coherentkris

          to get the count of records in a portal ( the many side of a 1 to many relationship ) put an unstored calculation field in the many table = Get ( foundcount ) and put that field on a layout based on the 1 table

          • 2. Re: Portal Count?
            fitch

            Or, in the parent table, create a calculated field:

            Count( clients foundset line items::_fkClientID )

            • 3. Re: Portal Count?
              BowdenData
              to get the count of records in a portal ( the many side of a 1 to many relationship ) put an unstored calculation field in the many table = Get ( foundcount ) and put that field on a layout based on the 1 table


              This is the preferred method. This has been proven to be quite a bit faster than doing a count from the Parent table.


              Doug

              • 4. Re: Portal Count?
                AndrewJudd

                Thanks very much all, I had tried get foundcount but was thrown off by some old records that needed to be deleted before it was correct. That seems the way to go. Another question about portals and updating summary records on parent layout but will start a new thread.

                 

                Cheers