User Guide

DataSet.useSort() 409
Example
The following example uses DataSet.hasSort() to determine if a sort named "customer"
exists. If it does, the code calls
DataSet.useSort() to make "customer" the current sort.
Otherwise, the code creates a sort by that name using
DataSet.addSort().
if (my_ds.hasSort("customer")) {
my_ds.useSort("customer");
} else {
my_ds.addSort("customer", ["customer"], DataSetIterator.Descending);
}
See also
DataSet.applyUpdates(), DataSet.hasSort()