Functions Reference

Table Of Contents
Logical functions
F
ILEMAKER FUNCTIONS REFERENCE 239
Example 1
If you sort records on a calculation field that's defined by the GetField function, you can dynamically
sort records and display subsummary data by changing the value of the field specified by GetField.
Suppose a database has four fields:
Customer Name, a text field
City, a text field
SortSelection, a global field
SortKey, a calculation field that's defined as Get("SortSelection")
This script goes to the Invoices layout and sorts records on the SortKey field:
Go to Layout ["Invoices" (Invoices)]
Sort Records [Restore; No dialog]
#Sort by the SortKey field
Go to Record/Request/Page [First]
If SortSelection contains "Customer Name", SortKey returns the values of the Customer Name field,
and the found set is sorted by Customer Name. Any subsummary data specified to appear when
records are sorted by SortKey is displayed from the Customer Name field.
If SortSelection is changed to contain "City", SortKey returns the values of the City field, the found
set is re-sorted by City, and subsummary data is displayed from the City field.
Because the found set is sorted by SortKey, the sort information is automatically updated when the
values returned by SortKey change, and you do not have to perform another sort operation.