1 Reply Latest reply on Nov 9, 2010 12:26 PM by philmodjunk

    Capture and store the Sort Order

    david583

      Title

      Capture and store the Sort Order

      Post

      FM Pro 10 & FM Pro 11, FM Server 11 on shared network. Solution built on FM Pro 10 ,Windows XP OS

      Is it possible to Get(sort_order) or something similar? i.e. capture and store the sort order and wether it's ascending or descending.

      I have many single field sort buttons as column headers as well as a sort button that opens the dialog for multi field sorts. It would be nice to display the current sort order on the list.

      More importantly, it would be a great help if I could store an order and direction to come back to from future layouts. i.e. like a 'back arrow' sort of function.

      Anyone had any ideas along these lines? I can do it fine from the single field buttons by setting a global text field value, but I can't figure out a way to store the direction. As for the multi field sort dialog, I have no idea.

      Any help would be appreciated.

        • 1. Re: Capture and store the Sort Order
          philmodjunk

          It would be nice to detect the current sort order, but that isn't something you can do with FileMaker as far as I know. Here are some things that you can do:

          Your sort scripts can load global fields or global variables with data so that the same sorting script also makes a record of the selected sort order. You can even use these with conditional formatting to provide a visual indicator of the sort order, say by displaying column headers of a list view layout in italics or bold face if they are part of the current sort order.

          "it would be a great help if I could store an order and direction to come back to from future layouts. i.e. like a 'back arrow' sort of function."

          In addition to the first trick, it's sometimes useful to know that each table occurrence box in your relationship graph has it's own current record, found set and sort order. If you have two layouts for the same data that you need to flip back and forth between, linking each in Layout Setup... to a different table occurrence--but to the same data source table will enable you to work with data on both layouts without sorts, finds etc performed on one one table affecting the sort order, found set etc. on the other.

          If "table occurrence" is a new term, you might read this tutorial:  

          Tutorial: What are Table Occurrences?