### Method

# EDataBook DataBookView set_sort_fields

since: 3.50

#### Declaration [src]

    void
    e_data_book_view_set_sort_fields (
      EDataBookView* self,
      const EBookClientViewSortFields* fields
    )

#### Description [src]

Sets `fields` to sort the view by. The default is to sort by the file-as field. The contacts are always sorted in ascending order. Not every field can be used for sorting, the default available fields are `E_CONTACT_FILE_AS`, `E_CONTACT_GIVEN_NAME` and `E_CONTACT_FAMILY_NAME`.

The first sort field is used to populate indices, as returned by e_data_book_view_dup_indices().

Note: This function can be used only with `E_BOOK_CLIENT_VIEW_FLAGS_MANUAL_QUERY`.

Available since: 3.50

#### Parameters

`fields`

  Type: `EBookClientViewSortFields`

  An array of `EBookClientViewSortFields` fields to sort by.

  The data is owned by the caller of the method.