CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to limit list of states to certain options
Pages: [1]

Author Topic: How to limit list of states to certain options  (Read 910 times)

areaten

  • Guest
How to limit list of states to certain options
August 18, 2009, 01:33:24 pm
Hi, I want to have a multi-select list of London (UK) Boroughs plus a National option and an International option for contact records.

I thought of using the core address field for States list, localised to English UK, but it appears there is no way of manually limiting the list to certain options. It's all the states (actually counties) of the UK in list.

I would normally just approach this by making a custom field with custom options, but at a later date we want to extend the options to include the whole of the UK counties list.

Any recommendations to how I would approach tackling this, or a solution for selecting to make available only certain states in the list?

Thanks

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: How to limit list of states to certain options
August 19, 2009, 04:58:03 am
Quote
Hi, I want to have a multi-select list of London (UK) Boroughs plus a National option and an International option for contact records.

Is this for use somewhere else apart from the address?  Want to give more information about how you want to use this data?

Quote
I thought of using the core address field for States list, localised to English UK, but it appears there is no way of manually limiting the list to certain options. It's all the states (actually counties) of the UK in list.

'Counties' isn't quite right either actually. It is an ISO list (3166-2 I think) which is quite complex (look at the UK section of the table on this page http://en.wikipedia.org/wiki/Table_of_administrative_divisions_by_country for a taste of the complexity) and means that there is overlap which can cause confusion.

The same address could be correctly assigned both 'London' and 'Westminster', 'Greater London' and probably some others, and that is a pain.  This is something a lot of UK people suffer with - and probably people in other places too (we talked about it at our recent dev camp).  But don't blame CiviCRM - the problem here is 1,000+ years of politics etc.

I tend to give up and create my own list with custom data as you have suggested.  But it would of course be great to improve how Civi handles this.

Your idea of being able to limit the available counties sounds likes a good one.  A better understanding of the relationship between the different levels of administrative divisions and how CiviCRM employs them would be helpful.

ps. you can introduce yourself here if you like: http://forum.civicrm.org/index.php/board,34.0.html
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

rogerco

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 5
Re: How to limit list of states to certain options
August 24, 2009, 05:56:05 am
My approach when I wanted to limit the size of the options to a specific subset of Counties (eg just one region) was simply to delete all the unwanted ones in table civicrm_state_province. (need to do this before you start entering data so you are sure you aren't left with any values elsewhere linking to deleted entries in the table)

If you are only dealing with UK you could also delete all the ones that aren't country code 1226

You could then add or edit to get the options you want.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to limit list of states to certain options

This forum was archived on 2017-11-26.