Sorting allows the fields in the subform to be sorted in a specific order. The subform field comes with the ability to sort the rows added within the subform and this option is available in its field properties. The sorted order will be retained in reports or while opening the form to update records.
The custom sort property for subforms is supported in both C5 and C6.
Sort type
You can specify the order in which the subform records must be sorted. The two types of sorting allowed include:
Field-based - Auto-sort subform records based on a form field in ascending or descending order.
Custom - Allow users to sort the records in a custom order by effortlessly dragging and dropping the rows.
Custom sorting can be used both in List and Grid-type subforms.
Using the custom sort property, users can manually reorder the row sequence of a subform, while adding and editing records. This functionality is best suited for use cases that go beyond field-based sorting and require the subform's fields to be sorted in a particular order.
Things to know
Currently, you can drag and drop up to 200 subform rows using the custom sort option.
The custom sort property will be enabled only if a combination of records and subform rows in your form does not exceed 10,000.
If your form has 10,000 records or if a subform field in your form has 10,000 rows, then this property will not be enabled for that field.
Consider the following cases.
Case 1: Let's say your application has 500 records and each record has a subform field with 20 rows.
Case 2: Let's say your application has 100 records and each record has a subform field with 100 rows.
The custom sort property will not be enabled in both the above cases since the 10,000 limit criteria for records/subform rows has been met.
Note:
The 10,000 records limit is applicable for the following versions of Creator applications: C5 applications (sandbox included) and C6 applications in which you haven't enabled environments.
Enable subform field sorting
Open the form builder.
Select the required subform field.
Navigate to Field Properties on the right.
Select the checkbox beside Enable Sorting under Sorting.
Tick the checkbox beside the required sort type - Field-based or Custom.
If you've chosen the Field-based sort type:
Select the Field from the dropdown based on which sorting should be applied. To check which fields are supported inside a subform field, click here.
Select your preferred Sorting Order - Ascending or Descending.
If you've chosen the Custom sort type, you can sort subform rows by dragging and dropping them based on your requirement in the live mode of your application.
Click Done to exit the form builder.
You can now access your application in live.
When accessing the report or editing the subform record, you can observe that the field-based sorting will be applied to the subform field.
When you add rows to your subform field, you can drag and drop the rows if you've chosen the custom sort option.
Note:
For composite fields, sorting should be done based on the subfield (for example First Name or Last Name for Name field).
The sorting option and view type you've chosen for your subform fields in web browsers will automatically be applied to both mobile and tablet devices.
If you've chosen the field-based sorting option, subform records will be automatically sorted based on a form field in either ascending or descending order.
If you've chosen the custom option, your users can sort the records by manually dragging and dropping the rows in their preferred order.