Often it is desirable to present records in reverse order - from newest to oldest - or just "the other way round" with respect to the current sort order.
Idea: A new checkbox in the sort script step(s):
[X] Reverse order
which simply causes the results to be displayed in reverse order.
This checkbox should appear in the 3 script steps:
- Sort records
- Sort records by field
- Unsort records
as well as in relationship and portal sorting areas.
Thus to get the very frequently needed 'newest first' order - WITHOUT ACTUALLY SORTING - and thus WITHOUT DELAY, the following step is needed:
Unsort records[ Reverse order ]
[EDIT] 2018-07-04 MrW: Since we now have Master-Detail portals with FileMaker 17, I wish to extend this idea to also be applicable to Found-Set Portals => see NEW Use case!
- Easily, quickly and efficiently display records in a natural order.
- This method should be extremely efficient (depending on how FileMaker stores its data internally) as it does not require sorting per se!
- The method is scalable (current reverse-sort implementations tend to rapidly become unusable as tables grow + causes problem after deployment)
- i.e. less maintenance of unscalable workarounds
- It will make it possible to show large tables in 'newest first' order WITHOUT unbearable sorting times
- You can turn a complicated sort around with one option, without having to negate each field sort order
- Note - this would require FileMaker to recognize that the sort order is the same as the current sort order and apply only the "Reverse order" option
- alternatively the Sort records by Field step could be used to apply the option by selecting NO field (hm, maybe)
- All tables, list-layouts + portals where it is useful to list 'newest first' (orders, invoices, addresses, etc.)
- Reverse order relationships to discover info / the timestamp of newest entries (WITH no sorting, no portal and no GetNthRecord).
- Reports + Charting layouts:- Toggle between best + worst case scenarios without having to resort
- Chat portals (with new chat at the top)
- [NEW] Use with Master-Detail portals + reverse found set to get a top-first portal
It would probably be necessary to have a Get-function to read the state of the reverse-order option, and to be integrated into the New function to see current sort fields and the (coming) Sort field <by calculation> script step.