5 Replies Latest reply on Nov 17, 2010 10:53 AM by WinstonChurchill

    Sorting Portals

    WinstonChurchill

      Title

      Sorting Portals

      Post

      sorting portals

      Been away for a while and I find I've gotten more than a little rusty on my return, indeed I feel like I'm back at square one almost.

      My goal is to touch the small button (unfinished) to the left of the bin (top RH corner of portal) and have the portal sort into the order in which the records are entered (of course without portal settings set to sort, it does this anyway). But I wish to touch it a second time and have the portal sorted according to 'Name', a third time to have it return to sort by order entered and so on.

      Sorting by order entered, I believe I can do by using the auto enter serial number field to sort by, sorting by name seems a bit more difficult since the bit I want to sort by initially is the 's' in the example shown. The 's' could be 's, se, e, ne, n, nw, w or sw' in that order, then I wish to sort by the 'i' in the example above which could be 'empty/no value or i' in that order and finally sort by the '.1/.2' which could be ' empty/no value, .1, .2 etc etc.

      This all seems a bit difficult from my current view point, but isn't my initial issue at the moment, but ultimately I'd like to sort according to the following example (I'm not using the values in the image above):

      z0/01/s, z0/01/s.1, z0/01/si, z0/01/si.1, z0/01/si.2, z0/01/ei, z0/01/ei.1, z0/01/n, z0/01/ni, z0/01/w, z0/01/w.1, z0/01/w.1+, z0/01/wi, z0/01/wi.1, z0/01/wi.2

      Just at the moment though I can't even get the button to sort the portal at all, is it even possible to sort the portal by the button I've added or can I only use the portal set up sort option (I have more than one portal on this layout)

        • 1. Re: Sorting Portals
          philmodjunk

          FileMaker Portals can't sort dynamically. You have two options to get the effect you describe:

          Create a series of portals each specifying a different sort option and place them in different tabs of a tab control or in completely different layouts. You "sort" your portal differently by selecting a different tab or layout.

          Create a calculation field or two that returns values from different fields based on the value specified in a global field or variable. You then specify this field or fields in your portals specified sort order. Now you can manipulate the order of the rows in the portal by changing the value of the global variable or field.

          • 2. Re: Sorting Portals
            WinstonChurchill

            Many thanks Phil, it's good to know it wasn't inability on this occasion that was preventing me progressing and you've saved me a good deal of time keep trying.

            I think I'll go for a dual layout approach and abort the notion of sorting each portal on the layout independently for the moment (too many permutations - too many layouts)

            Sorting by name as I described before looks quite daunting by calculation at the present time, I'm looking to achieve this with an extensive value list that contains all likely possibilities, a bit of work, but it seems more straight forward, does this seem like a reasonable approach to you or is there a better way.

            • 3. Re: Sorting Portals
              philmodjunk

              That value list approach seems pretty problematic. It could work, but it will be a lot of work to set up and it would be easy to get a value wrong in the list or leave one out.

              I assume we are talking about the field that stores this data: z0/01/s, z0/01/s.1

              I'd try to split those values into separate fields and then sort on the separate fields instead of this string.

              • 4. Re: Sorting Portals
                WinstonChurchill

                I'll give that a go then, the name field is already calculated from a subset of other fields comprising the various parts of the name as a whole, so I likely don't have a lot of work in that case. Many Thanks for your help.

                • 5. Re: Sorting Portals
                  WinstonChurchill

                  Actually I think i need a combination of both approaches, sort by subset fields and simpler much shorter value lists (I need to order things in an order that only make sense from my own perspective, ie... s, se, e, ne, n, nw, w, sw which follows no logical alphabetical or numerical order)