7

I would like to disallow certain address location types on Organization contacts—for example I don't want to allow "Home" addresses on an Organization.

I would also like to disallow "Main" address type on the Individual contact types.

Anybody try this before?

3

The cheapest solution would be to combine "Home" and "Main" into one option that can be used for both individuals and organizations. Just have to come up with a word that has both meanings...

  • Like Physical Location ? – petednz - fuzion Jun 9 '15 at 1:42
  • 1
    Just using the Main location type seems an option to me. For an individual their main address is usually their home address – JoAnne Jun 13 '15 at 8:03
  • Thanks Coleman for your sensible and practical answer. It ended up being the solution to my issue. – Link Swanson Jun 16 '15 at 16:48
2

Frankly, CiviCRM core should disable the Home address location for Organizations, and the Work address location for Households.

  • I agree. Enabling these types based on context would probably lead to less data entry mistakes overall. And it can bite you hard when your addresses or phone numbers have inconsistent location types! – Link Swanson Jun 16 '15 at 16:47
1

If the solution suggested by Coleman does not work, you will have to create a little extension that removes some of the options based on contact type in a buildForm hook? Or alternatively validates the selected location type against the contact type in a validateForm hook

1

I suspect doing this in jQuery via a custom behavior template addition:

https://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates

is probably a lot lighter weight, than an extension

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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