2 Replies Latest reply on Jan 6, 2016 8:32 AM by DanielShanahan

    Total records from portal in tab control


      I have set up a tab control object with multiple tabs. Every tab has a filtered portal on it. The filter is based upon the name of tab name. It's something like you have a layout with tab control object on it. The tab control has several tabs such as "Unpaid" and "Paid". Each portal on the tab filters the record based on a record called InvoiceStatus. Now what I want is that the tab control shows the total of records found in the portal. Like: "Unpaid (3)" and "Paid (6)". Is there a way to make this work?


      I currently have it showing all the records in the table by using a summary field in the table. I just don't see how I can filter this. Hopefully someone can help me :-)

        • 1. Re: Total records from portal in tab control

          I think this is what you are after

          What I did following suggestions elsewhere in this form (and because I can wrap my head around how it is/was done) is used  a global field to calculate the found count in the portal (child table). Then I created a one row portal based on the same filter as the portal in the tab with the global found count field. Not sure how many 'found' records you are expecting so field size may be an issue in order to display properly

          Screen Shot 1.jpg

          [Looking at it now I think I need to nudge it down a bit - not lining up quite nicely enough!]

          • 2. Re: Total records from portal in tab control

            Hi Don,


            I can think of a couple of options:


            1. Use the ExecuteSQL () function with the COUNT function.  E.g.

            ExecuteSQL ( "

              SELECT COUNT (ID)

              FROM invoice

              WHERE status = ? "

              ; "…" ; "" ; $status



            2. Change the filtered portal to filter via the relationship.  While this adds more table occurrences it also enables you to use a Count () function in a field calculation.  E.g.

            CUSTOMER::countPaid = Count ( CUSTOMER_invoice::ID )