Answers.Body: <p>Depends on what you want exactly. You can define the way in which the display name and sort name are constructed in Administer&gt;Customize Data and Screens&gt;Display Preferences. But that will affect the way it is built up all over the system, not just in the activity search. And this is typically a setting you configure at the start of your CiviCRM usage. It does not update all the existing contacts automatically if you change the settings, just do it differently when you change a contact.</p>
  <p>The other alternative would be to customize the activity search programmatically to adjust the display name only on the activity search.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-01T08:55:24.397Z
Answers.Text: As I said in my question, I specifically need it to work in the "With" column in the activity search results. It might be possible to edit the code of some file but I don't know which one.
Answers.UserDisplayName: Suri Gang's Hallen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-01T13:28:47.257Z
Answers.Text: Have you checked the CiviCRM Developer Guide? https://docs.civicrm.org/dev/en/latest/? It is a little more than just editing a file :-) What you could do is create your own activity search using Search Kit, check the chapter in the Developer Guide.
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-01T19:02:36.957Z
Answers.Text: You're misplaced since the documentation talks about Hooks as a possible solution, however, if there are variables in PHP functions that show the short name, you can surely put "First name and then last name", BUT I STILL CAN'T FIND A WAY.
Answers.UserDisplayName: Suri Gang's Hallen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-04T08:05:20.627Z
Answers.Text: I am sorry you can not find a way but I would prefer you not to shout to me? The CiviCRM community consists of volunteers and shouting at us is not appreciated. CiviCRM is a large and functionally rich bit of software and if you want to change the sequence programmatically you will have to check how to write an extension. As stated, the alternative is to create your own activity search using Search Kit, there is a chapter on that in the Developer Guide too. Good luck!
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-01T08:43:43.390Z
Answers.LastActivityDate: 2023-12-01T08:43:43.390Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>In my organization we have specific needs with the search for activities. In the activity search results we <strong>want to show the results of the &quot;With&quot; column first the First Name and then the Last Name</strong> and currently we have it the other way around.</p>
  <p>It is possible to modify the order of how the name is displayed in the activity search results column?</p>
  <p><a href="https://i.sstatic.net/woqYc.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/woqYc.png" alt="enter image description here" /></a></p>
  
Tags: <activities><search><search-results><admin>
Title: Show first name and then last name in activity search results
ThreadText: # Show first name and then last name in activity search results
  
  (Asked by: username_0 on 2023-12-01)
  
  In my organization we have specific needs with the search for activities. In the activity search results we **want to show the results of the "With" column first the First Name and then the Last Name** and currently we have it the other way around.
  
  It is possible to modify the order of how the name is displayed in the activity search results column?
  
  [![enter image description here](https://i.sstatic.net/woqYc.png)](https://i.sstatic.net/woqYc.png)
  
  **Tags:** activities, search, search-results, admin
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-12-01. Score: 2
  
  Depends on what you want exactly. You can define the way in which the display name and sort name are constructed in Administer>Customize Data and Screens>Display Preferences. But that will affect the way it is built up all over the system, not just in the activity search. And this is typically a setting you configure at the start of your CiviCRM usage. It does not update all the existing contacts automatically if you change the settings, just do it differently when you change a contact.
  
  The other alternative would be to customize the activity search programmatically to adjust the display name only on the activity search.
  
  > **Comments:**
  > **username_0**: As I said in my question, I specifically need it to work in the "With" column in the activity search results. It might be possible to edit the code of some file but I don't know which one.  
  > **username_1**: Have you checked the CiviCRM Developer Guide? https://docs.civicrm.org/dev/en/latest/? It is a little more than just editing a file :-) What you could do is create your own activity search using Search Kit, check the chapter in the Developer Guide.  
  > **username_0**: You're misplaced since the documentation talks about Hooks as a possible solution, however, if there are variables in PHP functions that show the short name, you can surely put "First name and then last name", BUT I STILL CAN'T FIND A WAY.  
  > **username_1**: I am sorry you can not find a way but I would prefer you not to shout to me? The CiviCRM community consists of volunteers and shouting at us is not appreciated. CiviCRM is a large and functionally rich bit of software and if you want to change the sequence programmatically you will have to check how to write an extension. As stated, the alternative is to create your own activity search using Search Kit, there is a chapter on that in the Developer Guide too. Good luck!  
  
  ---
  
  