Answers.Body: <p>I found an answer - by editing the file <b>com_civicrm/civicrm/CRM/Case/Selector/Search.php</b>.
  I inserted the following line after line 427:</p>
  
  <p><b>'sort' => 'case_subject',</b></p>
  
  <p>This makes the Subject column clickable for sorting.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-15T12:30:37.993Z
Answers.Text: You should not be editing the core file. Copy the file to custom PHP directory and then makes changes. More information about custom PHP in this page https://wiki.civicrm.org/confluence/display/CRMDOC/Directories
Answers.UserDisplayName: Ghost
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-15T11:44:59.217Z
Answers.LastActivityDate: 2016-07-15T11:44:59.217Z
Answers.UserDisplayName: Jern
Body: <p>When I search for Cases, the search results are sortable by clicking on any of the column headings except for Subject and Case Manager. I would like to order the results by Subject - either by clicking on the Subject column heading, or by editing the appopriate php or tpl file so that the results are ordered by Subject by default. Can someone please point me in the right direction for the file(s) which I should edit to change the sort order? Thank you.</p>
  
Tags: <civicase><search-results><sort-order>
Title: Searching by case - would like to sort by subject - greyed out
ThreadText: # Searching by case - would like to sort by subject - greyed out
  
  (Asked by: username_0 on 2016-07-15)
  
  When I search for Cases, the search results are sortable by clicking on any of the column headings except for Subject and Case Manager. I would like to order the results by Subject - either by clicking on the Subject column heading, or by editing the appopriate php or tpl file so that the results are ordered by Subject by default. Can someone please point me in the right direction for the file(s) which I should edit to change the sort order? Thank you.
  
  **Tags:** civicase, search-results, sort-order
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-07-15. Score: 1 | Accepted answer
  
  I found an answer - by editing the file **com\_civicrm/civicrm/CRM/Case/Selector/Search.php**.
  I inserted the following line after line 427:
  
  **'sort' => 'case\_subject',**
  
  This makes the Subject column clickable for sorting.
  
  > **Comments:**
  > **username_1**: You should not be editing the core file. Copy the file to custom PHP directory and then makes changes. More information about custom PHP in this page https://wiki.civicrm.org/confluence/display/CRMDOC/Directories  
  
  ---
  
  