Sort

Sorting Overview: Header Sort vs. Toolbar Sort

Wave offers two sorting methods to help users organize and analyze grid data effectively: Header Sort and Toolbar Sort. While both improve data visibility, they operate differently based on how the data is accessed and processed.

Sorting Method
Behavior Type
Based On
Affects All Data?

Header Sort

In-grid (local)

Data type detected in grid

No – loaded records only

Toolbar Sort

Server-side (query)

Salesforce sort result

Yes – all records

Understanding the difference between these two methods helps ensure consistency, especially when working with large datasets or fields containing mixed data types.

Header Sort (Column Header Actions)

Sorting from the column header behaves similarly to how sorting works in Excel: it's local, fast, and applies only to the data that is already visible in the grid.

Key Characteristics:

  • No call is made to Salesforce; sorting is applied to the loaded dataset only.

  • The grid automatically detects the data type of the column:

    • Numbers → Sorted numerically (e.g., 1, 2, 10)

    • Text → Sorted alphabetically (A to Z)

  • Sorting is temporary and resets when the grid is refreshed or reopened.

This method is particularly useful when a quick, in-grid sort is needed for the current view without querying the full dataset.

Column Header Sort

Toolbar Sort (Toolbar - Sort)

Toolbar Sort behaves more like a Salesforce list view sort. It sends a query to Salesforce and returns the sorted data as part of the response. This ensures that the entire dataset is sorted, not just what’s visible.

Key Characteristics:

  • Retrieves and sorts all applicable records using a Salesforce query.

  • Sorting behavior depends on the underlying data type in Salesforce:

    • Text fields → Sorted alphabetically

    • Date fields → Sorted chronologically

  • In cases where numbers are stored as text fields, the sorting may not follow numerical order (e.g., 1, 10, 2).

This method is best used when sorting large volumes of data or when the sort order needs to remain consistent across views or sessions.

Toolbar Sort

Best Practice: Ensure Consistent Data Types

When sorting differences occur between Header Sort and Toolbar Sort, it's often due to inconsistent data types—particularly when numeric values are stored as text in Salesforce.

Recommendation: Ensure that fields containing numeric values are configured as Number data types in Salesforce. This improves sorting accuracy and alignment across both methods.


Last updated

Was this helpful?