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 »
  • Pre-installation Questions (Moderator: Dave Greenberg) »
  • Groups or custom fields to handle contacts in hierarchical administrative areas
Pages: [1]

Author Topic: Groups or custom fields to handle contacts in hierarchical administrative areas  (Read 1228 times)

jclemo

  • I’m new here
  • *
  • Posts: 15
  • Karma: 1
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • MySQL version: 5.0.95
  • PHP version: 5.3.10
Groups or custom fields to handle contacts in hierarchical administrative areas
April 04, 2012, 06:20:46 am
I’m looking at migrating from our aging bespoke CRM system to CiviCRM and as suggested I’m asking for some community help in the planning phase.

Parish geography is key for our method of working (a small neighbourhood level administrative boundary for those of you not familiar). We need to be able to identify groups within a parish but also which groups are within a district (and county) the next highest administrative boundary (e.g. all parishes are within a district all districts are within a county). I’m exploring methods of doing this

Groups using a hierarchy seems the most obvious and flexible. This produces two challenges. The first is from what I can see the parent group doesn’t show up on the organisation’s record- is their a quick fix for this (can see a custom hook solution to populate a field)? The second is that we would need to add an extra field to the groups table to contain a foreign key we use for wider GIS reporting (can add this straight into the database but would appreciate anyone flagging up whether this causes any programmatic issues).

The other option would be to use a custom field set. The idea would be to have the development officer select the parish from a dropdown and a custom hook would populate a district and county field (I would love some examples of this with a database query to set a field value as I’m not confident in PHP, also has anyone used triggers in mysql to achieve the same results to populate a custom field).

My preference for ongoing use at the moment is for the groups hierarchy to leverage the other build in features but would appreciate any thoughts/ideas. In reality I have a feeling we would use custom fields to help with the import process and assignment to groups.

many thanks- Jon

britebyte

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 2
  • CiviCRM version: Several 3.4+, 4.1+
  • CMS version: Drupal 6, Drupal7
  • MySQL version: Several 5.1+
  • PHP version: Several 5.2+
Re: Groups or custom fields to handle contacts in hierarchical administrative areas
April 12, 2012, 08:01:05 am
Please keep in mind I am pretty new to CiviCRM but I thought it was an interesting question so here's what I thought:

Have you considered creating contact subtypes of the built-in Organization type: Group, Parish, District, County and creating custom relationships between them? You can add your custom GIS field to these custom types using the admin backend. This avoids having to hack the group table.

With my knowledge at this point I would agree that you need to add custom fields to display the parent  organizations and probably a hook to update them. Your idea of MySQL trigger might be a good one as well. With either the hook or the trigger you need to update it when migrating versions etc.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Pre-installation Questions (Moderator: Dave Greenberg) »
  • Groups or custom fields to handle contacts in hierarchical administrative areas

This forum was archived on 2017-11-26.