Setting sort order and visible levels


Use the Sort/Levels or Sort property to specify the following:

  • The order in which data appears when a table is refreshed--that is, the primary sort column, the following sort columns, and columns that do not participate in the sort.
     For example, if you sort first by Assembly Manager and then by Part Number, requests appear alphabetically by Assembly Manager in list views. In tree views, Assembly Manager values are higher in the tree hierarchy (further to the left in the tree display) than Part Number values.
  • The default sort direction (ascending or descending) for each column. Users can click a column heading to re-sort data in the opposite direction.
  • (Tree view) The visible tree levels.

If you do not define a sort order for a list view, results list, or alert list, requests appear in ascending order based on the Request ID.

If you do not define a sort order for tree views, AR System sorts the tree by the column at the top of the Table Columns list in the Tree/Table Property dialog box.

In a browser you cannot sort on columns that reference display-only fields.

To set sort order and visible levels

  1. Select the appropriate table field.
  2. In the Properties tab, select one of the following properties, and click its ellipsis button:
    • (List view, tree view, alert list, results list tables) Sort/Levels
    • (Cell-based tables) Sort
  3. In the Available Columns list of the dialog box, select the columns by which you want to sort the table data.
     Table columns associated with character fields whose input length is more than 255 characters do not appear in the Available Columns list.
  4. Click the arrow button to move the selected columns to one of these lists:
    • (List view, tree view, alert list, results list tables) Sort Order/Tree Levels
    • (Cell-based tables) Sort Order
       Columns that are not included in the sort order do not appear in tree view tables at runtime. They can still, however, be used in workflow.
  5. Use the Up and Down buttons to set the sort order of the columns or levels.
     The field that appears at the top of the list has the highest precedence.
  6. To change the sort direction of a column, click its Sort Direction cell.
     Clicking the cell switches the sort direction between ascending and descending. Ascending order for numeric fields means that values such as lower ID numbers or earlier dates appear at the top of the table list. Ascending order for character fields means that requests are sorted alphabetically from A to Z.
  7. (Tree view only) To create hidden sort levels, select each column that you want to hide, and click its Visibility cell.
     The Visibility value changes from Visible to Hidden.
  8. Click OK.
  9. Right-click the form, and select Save.

Sorting tables in browsers

Requests to sort data in table columns are sent to the AR System server, which sorts the underlying data in the database. The display-only columns cannot be sorted in browsers because their data is not stored in the database. In addition, if users change column data in the browser but the change is not pushed to the form, the changed data is not included in the sort because it is not in the database.

Arranging nodes in tree view tables

The nodes in each level of a tree view table are sorted alphanumerically. To arrange nodes in a logical order, use hidden sort levels. For example, suppose your source form contains this data: 

tree_view_data_no_sort.gif

If you use the TypeSeverityPriority, and Description fields as levels in a tree view table, their data is sorted alphabetically and appears in an unintuitive order: 

tree_view_alpha_sort.gif

To arrange each level in a logical manner, add Type SortSeverity Code, and Priority Code sort fields to the form: 

tree_view_data_and_sort.gif

Then add the new sort fields as levels to the tree view table field in the order shown in the preceding figure. The following figure shows the resulting tree view table when the new sort levels are visible and when they are hidden: 

tree_view_logical_sort.gif

When the sort levels are hidden, child nodes of a node in a hidden level appear as children of the first visible ancestor of the hidden node.

Best practice
We recommend that you hide only levels used for sorting. Do not hide levels that contain data leaf nodes. If a visible parent node with multiple hidden leaf nodes is selected, workflow selects only the request represented by the first hidden leaf node in most instances. It does not select the entire set of leaf nodes associated with the parent node. See Tree-view-table-fields.

The PERFORM-ACTION-TABLE-SELECT-NODE command selects nodes according to a specified row and column (level) offset. If a tree view table contains hidden levels, this action might select a hidden node. If it does, the selection is rejected and the first visible ancestor is selected instead. 

For example, in both of the following tables, the action was instructed to select row 1, column (level) 2: 

tree_view_select_hidden.gif

If the action is instructed to select row 1, column 3 in the preceding example, it selects the Change node in both tables.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*