5 Replies Latest reply on Sep 12, 2013 2:09 PM by philmodjunk

    Sorting in Portals

    CeciliaBaldwin

      Title

      Sorting in Portals

      Post

           I'm trying to create a database for all the purchased items that are my expenses. As my items are in categories, is it possible to have them sorted in relating portals to display only one category? If so, is it possible to have multiple portals from the same table that are simply sorted to display a different category in each ? 

            

           For example  - one portal showing our monthly food costs would look like:

           Portal - Expense - Supplier - Item

            item id , purchased date  / supplier id / category - food expense 

           second portal in same table : 

           Portal - Expense - Supplier - Item

            item id , purchased date  / supplier id / category - clothing expense 

            

           Is this possible? Thank you for any help!

        • 1. Re: Sorting in Portals
          philmodjunk

               "sorted" isn't quite the right term, but yes. If you are using FileMaker 11 or 12, you can set up filtered portals where the filter expression limits the portal records to just those that meet the filter criteria.

               The portal filter for your first portal might look like this:

               PortalTable::Category = "Food" // or maybe "food expense" -- whatever value identifies food expense records

               In earlier versions, this is still possible, but the "filtering" has to take place at the relationship level with different combinations of match fields.

               But these are not the only options.

               ExecuteSQL calculations could produce tab and return delimitted data such that you get the same basic result, but in a single field instead of a portal.

               A summary report can be set up on the portal's table with SubSummary layout parts such that each expense category is listed as a sub heading with the expense records from that category listed below it and with a sub total computed for that category.

               This last option can be a better approach if you need this for a report--especially a printed report.

          • 2. Re: Sorting in Portals
            CeciliaBaldwin

                 I think the easiest and best way would be the portal filter . When I went to try it, I couldn't get it to work but I think it is because my category's are defined by a value list. Do I need to identify the value list and then desired value? 

                 For ex: PortalTable::Category :: valuelist_category ="Food expense" ? 

                  

            • 3. Re: Sorting in Portals
              philmodjunk

                   Nope. You need to correctly reference the field that you have formatted with the value list and it needs to match values exactly. The presence of a single space or a return character can keep the above expression from working because then the text in the field doesn't exactly match the text in quotes.

                   Are your categories selected from a set of checkboxes or a different format of value list? (checkboxes can complicate this process as the field then can store multiple values separated by returns.

                   And make sure that your field is defined as a field of type text and not number...

              • 4. Re: Sorting in Portals
                CeciliaBaldwin

                     I have it matching exaclty, my field is a text, ... I think I must be missing something. Should the category be an id? It's not coming up as an error; it's just showing me all of the items - no filtering. (And just in case I made sure that field was included in the displayed portal fields. 

                • 5. Re: Sorting in Portals
                  philmodjunk

                       It does not need to be an ID. It won't bring up an error message if it doesn't work. The field does not need to be visible in the portal--but it can help for debugging errors.

                       Please copy and paste the exact filter expression you are using inside Portal Setup for this portal. Please identify the exact text shown in the "Show Related Records From" drop down in portal setup for this portal.