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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • inherited/linked fields
Pages: [1]

Author Topic: inherited/linked fields  (Read 760 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
inherited/linked fields
May 27, 2010, 01:51:32 pm
It would be great to have some way to have inherited or linked fields. For example, a statewide organization may create geographic regions to organize their members. The regions are applied to organization type records. But they would like to search for individuals employed by the organizations, based on that field.

So I would envision a structure similar to how membership relationships work --

We create a "region" field attached to the organization contact type.
There is an additional option to select a relationship, indicating other contacts who will inherit the field (preferably multi-select).
The value is passed to the related record in view only mode -- the field cannot be edited -- only the owner record can edit.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: inherited/linked fields
June 01, 2010, 09:37:57 am
Brian - One possible approach to this within current version is to define a "view only" custom field at the "child record" level and calculate it's value based on relationship + value of corresponding "parent record" field. For your example:

Parent record = Employer,  Select type custom field = Region
Child record = Employee, View-only custom field = Region, value is calculated via PHP code which queries Employer of this individual and selects the region.
Protect your investment in CiviCRM by  becoming a Member!

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: inherited/linked fields
June 01, 2010, 10:08:51 am
yeah, I was giving some thought to doing it that way.
the problem I foresee is if the parent value is changed -- there would need to be a way to recalculate the value for all children.
i probably could use the postprocess hook to grab the changed value and copy to the children.
will need to give it some thought.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • inherited/linked fields

This forum was archived on 2017-11-26.