One of the missing features in FileMaker is the ability to add portal headers that can both sort portals and easily display the ascending or descending sorted order. Building and maintaining solutions that have sorting features has always been difficult to set up and maintain. It seemed as though adding and sorting was full of problems.
That is, until I found a great article by Kevin Frank on filemakerhacks.com. It is a multipart article about a very nice, fast sorting technique. I highly recommend you check it out. Geared more for the intermediate developer, it provides a great solution to sorting.
I began implementing the technique and was very happy with it. It seemed as though many of my portal sorting issues were solved. The sorting technique worked great, but a problem still remained. It was lacking a nice user interface that made "click to sort" feel like it should. Kevin’s technique was solid, but FileMaker lacked a good user interface element. Because of this, it was difficult to manage and maintain. At the time, FileMaker hadn’t introduced .svg support. Using raster graphics for icons came with a bunch of problems. You could use text characters, but they just didn’t look good.
Fast forward to the days of .svg and the button bar, and suddenly things begin to click into place. The modular piece I am sharing with you is actually the visual interaction with that sorting function. There are still some challenges, but this gets a lot closer.
For the sample file, I created 12 buttons total. After implementing the structure for Kevin’s sorting technique, they can be placed on any layout and, as long as you set the global variables that drive them, they set the sorting dependency and sort portals or lists.
In the sample file, the global variables that drive the sorting technique are set by a conditionally formatted text object. It evaluates itself to create the globals listed. You could just as easily create them in a script or some other process. If you use a multi-file solution, you will want to use global fields instead of global variables, and you will want to change the tables sort field calculations to use the global fields as well.
You also need to be careful when pasting them on a layout; basically, make sure they don’t rename themselves. But other than that, they should be easy to use.