Generic sort function in FileMaker
QuickSort module for FileMaker Pro
QuickSort is a FileMaker module to sort according to any field of a table. The module is generic and intended for list views. Each table column gets a button (button, title). The field name is passed as a script parameter. No further adjustments are needed. The selected column is sorted alternately in ascending or descending order.
How it works
The script is started with the field name as parameter and makes a loop through all field names until the field name matches the script parameter. Then sort on this field name.
This works splendidly in the table of the current page. However, linked tables are unfortunately not taken into account. So if relational data should be included in the sorting, a separate setting is needed for these fields.
Strengths
- Generic sorting module
- Good for lists
- Easy to implement
Sample file to show a quick and generic sort for any list of any table.
Requires FileMaker Pro 12 or newer.
Implementation as a module
The file can serve as an example. However, the file is also structured as a FileMaker module. This makes it easy to import the entire file into another project.
- The module has step-by-step instructions for implementation in the script directory
- The order must be maintained so that no links are lost.
A FileMaker module is characterized by a simple structure. The structure can be easily understood in the script directory.
- Script folder
- Read my file (with implementation steps, dependencies, etc.)
- License information
- PREFERENCES (parameterization)
- TEST (test scripts, if available)
- PUBLIC (main directory. Only scripts from this directory are addressed directly)
- PRIVATE (Additional scripts that do not require any customization and are only used)
This structure is identical for all modules, even if individual parts may be missing because they are not required. Only the scripts from the main directory PUBLIC are addressed from other applications.
Modules are characterized by two features: They all use the same structure and separate functionality and parameterization. For the basic functionality of each script, it is sufficient to adapt the parameterization to your own needs. There is often a settings layout for this. This allows you to achieve basic functionality without development and script adaptations. Each module has its own tables, scripts and layouts. In addition, each module functions as a separate system. This makes it particularly easy to use the module in existing projects.