RecordSortedList.sortOrder Method [AX 2012]

Defines the fields on which the records are sorted.

public void sortOrder(FieldId fieldId,  )

Run On

Called

Parameters

fieldId
Type: FieldId Extended Data Type
The ID of the first field to sort the records on.
Type: [T:]

You can specify one or more fields to sort on.

This method can only be called one time on the same instance of the RecordSortedList class. You cannot change the sorting order after it has been set.

The following example creates a list of DimensionSetRuleTable table records, and then sorts them by the SetId field, and then by the HierarchyId field.

static RecordSortedList initRulesList() 
{ 
    RecordSortedList list; 
  
    list = new RecordSortedList(tablenum(DimensionSetRuleTable)); 
    list.sortOrder( 
        fieldnum(DimensionSetRuleTable, SetId),  
        fieldnum(DimensionSetRuleTable, HierarchyId)); 
    return list; 
}

Community Additions

ADD
Show: