2 Replies Latest reply on Nov 16, 2016 9:21 AM by David Moyer

    Displaying multiple counted records on one layout


      I've got 15 sales territories and I've created a layout that has 15 buttons that when activated will take me to the list of client on that particular sales route. However, I'd like to display the total number of clients on the layout below each of the corresponding buttons. Thus displaying the total count of clients in each of the 15 sales territories. This will of course help us determine which territory to place new clients based on the sales load of each salesman.

      Using FMP 12


      Thanks in advance.

        • 1. Re: Displaying multiple counted records on one layout

          I think the most structured way would be to have a dedicated table of these sales routes.


          Now create a Cartesian relationship (x operator) from the SalesRoute table to your layout table, so you can display all records in a portal. This also allows you to use them as buttons.


          If you add a summary field "Count of" to the Client table, and add a table occurrence of Client behind the SalesRoute table, you can display that summary field in the portal; it will show the count of related clients for each route. To recapitulate: you need


          LayoutTable x SalesRoute = Customer


          implemented as

          LayoutTable::anyField x SalesRoute::anyField, and

          SalesRoute::id = Client_forDashboard::id_salesRoute (or SalesRoute::name = Client_forDashboard::territory)


          Each portal row can now be used with Go to Related Record [ from: Client_forDashboard ]


          Hope that makes sense.

          • 2. Re: Displaying multiple counted records on one layout
            David Moyer


            this may be a rare occasion where a repeating field would be handy.  My thought is that you could populate a number repeating field (x15) with client count (via script).  Then, on your layout, you could use Merge fields like so:

            <<Table::RepeatingNumber[1]>> through <<Table::RepeatingNumber[15]>>

            (there are probably better ways to do this ... hopefully, you already ID your territories 1-15)

            p.s. the repeating field would use global repeating storage