4 Replies Latest reply on May 13, 2016 10:07 PM by laurensbrand

    Sort order of a layout




      I copied a layout and the form is working well but not the search and sort by. The sort order presented is still of the original object associated.

      I am not that familar with FM. Where do I specify the standard Sort Order for a layout? I am using a modified event management starting point as a base. Any help is highly appreciated.


      Screen Shot 2016-05-14 at 05.26.28.png

        • 1. Re: Sort order of a layout

          Records get sorted, not the layout.  It probably sorts from a script or script trigger.  You'll have to look at the original layout for a script trigger.  The script that takes you to this layout may also sorts the records.

          You mentioned a problem with a search?

          • 2. Re: Sort order of a layout

            Hi Steve,


            When i manually delete the 3 contacts::xxxxx sort orders and add the Sort List Key on the leads object then the sorting works well and also the find records. I believe I have checked every script or script trigger but for the live of me I can't find any place that sets the sort orders as in the first screenshot of the original post.

            Screen Shot 2016-05-14 at 06.35.40.png


            Screen Shot 2016-05-14 at 06.39.51.png


            Screen Shot 2016-05-14 at 06.38.18.png

            • 3. Re: Sort order of a layout

              Layouts do not have sort orders or found sets.  Tables do not have sort orders or found sets.  Table occurrences (TO's) do have sort orders.


              Layouts are based on TO's, and TO's are based on tables.


              To understand sorts and finds, it's necessary to understand table occurrences.  Here's a tutorial on the difference between a table and a table occurrence:


              Table vs. Table Occurrence (Tutorial)


              A TO's sort order is not permanent.  If the sort order is ever lost (like when you close Filemaker), it will have to be 're-sorted' later.  The default order is always oldest to newest records.


              If you want records in a layout to be sorted whenever you arrive at that layout, you can create a script trigger for the layout "On Layout Enter".  The script can be a simple sort script which performs the sort if the records are unsorted, and doesn't perform the sort if they are already sorted.


              Henceforth, until the sort is lost, any layout you navigate to which is based on the same TO will have that sort order. 


              Same rules apply to found sets.


              It's worth noting that sorting is one of those things that can be slow over the WAN.


              I've attached an image of where a layout's script triggers are modified (using the "Asset" start solution as an example). Layouts are accessed under File: Manage: Layouts


              Layout Script Triggers.jpg

              • 4. Re: Sort order of a layout



                Thank you all for the help. I found what I was looking for. I had copied the sort script for contacts to leads but did not know that I had to click on the radar of line 7 'Sort Records' in order to specify the sort order. Is that hidden or not :-).

                Also very hard to find in the documentation. I am not that familar with Filemaker yet.

                Screen Shot 2016-05-14 at 07.03.22.png