1

Civi 5.11, WordPress 5.1.1

I work with an organization whose Contacts (of all types) are limited to 4 states in the US. (Available States/Provinces in the localization settings includes only the US.) In order to speed up data entry for my organization's users, I'd like those 4 states to appear at the top of the States dropdown when new Contacts are added. However I don't see this capability in the Option Groups settings, and I don't see an Order field in the civicrm_state_province table.

Are my only ways forward to create a custom State field, or develop a custom hook?

1 Answer 1

0

If you don't want to write a hook then one option is to just update the name in the database so that it sorts to the top, for example:

update civicrm_state_province set name='_Washington' where name='Washington';

Or equivalently update the states you don't use so they sort to the bottom, like prefix a 'Z_'.

This might get overwritten by an upgrade if there's a change like a state gets annexed by Canada or something ... you're probably safe.

It's also possible some extensions might not work with it, but it's stored as an id not a word and the id doesn't change.

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.