2

I'm implementing CiviCRM for a client who works with African contacts whose names do not fit CiviCRM's first, [middle,] last format.

e.g. someone's name may have 4 parts, and may be presented in any order, although they will be presented in a particular way on their passport.

In terms of name display it seems that sort_name is favoured, but this presents names like: last, first. This jumbles the order in lists and is not helpful like it is with Western names.

I cannot put the whole name in the last name field and not use the first name because this is a requirement for creating a contact.

I would like to either

  1. get control over 'sort name', e.g. I could make it simply concatenate first name, space, last name, instead of last name, comma, first name.

  2. allow empty first names (then I can just use the last name field).

Is there a way to achieve either of these?

3
  • 2
    If you navigate to Administer->Customize Data and Screens->Display Preferences at the bottom you have two fields, Individual Display name format: {contact.first_name}{ }{contact.last_name} and Individual sort name format: {contact.first_name}{ }{contact.last_name} Does that help?
    – Andrei
    Commented Oct 6, 2015 at 21:56
  • That looks brilliant, will check out out, thanks! Commented Oct 6, 2015 at 22:04
  • Forgot to say that this will apply only to new contact, if that suits you and you decide to go that way, you will have to rebuild the sort name and display name. See this post forum.civicrm.org/index.php?topic=23125.0
    – Andrei
    Commented Oct 6, 2015 at 22:05

1 Answer 1

2

Many thanks to Andrei for supplying this answer in a comment:

If you navigate to Administer->Customize Data and Screens->Display Preferences at the bottom you have two fields:

Individual Display name format: {contact.first_name}{ }{contact.last_name} and
Individual sort name format: {contact.first_name}{ }{contact.last_name}

By updating this setting I can just put whichever is the first name in the first name field, the rest of the names in the last name field, and the records will always show name1 name2 name3 ... everywhere it is listed/sorted.

The last step was to update the existing entered names. I did this with the following SQL, which was appropriate for my particular use (and may not be for yours!):

UPDATE civicrm_contact SET sort_name = display_name
WHERE contact_type = 'Individual';

And now my names are working exactly as the client requested throughout the system. Many thanks.

1
  • Glad it helped!
    – Andrei
    Commented Oct 7, 2015 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.