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) »
  • Adding custom fields to group entries
Pages: [1]

Author Topic: Adding custom fields to group entries  (Read 5529 times)

ailgm

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
  • Drupal solution provider
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.15
  • MySQL version: 5.0.89
  • PHP version: 5.2.9
Adding custom fields to group entries
October 21, 2011, 01:55:57 pm
We'd like to add two (optional) fields to each entry/membership in some/all groups: notes and an order number.

A simple example where this would be used is to have a group of committee members.  Each member has a role, e.g. chairperson, secretary, etc. and an order we'd like to list them in (1,2,3,...).

Maybe I'm not looking in the right spot, so if there is a way to extend the data of who is in a group (beyond group ID, contact ID), please point me to it.  If not, suggestions as to how we could add a customization for it would be appreciated.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Adding custom fields to group entries
October 22, 2011, 01:35:09 am
We use relationships for that kind of thing? So the organization is added to CiviCRM and the relation between the organization and the member is 'chairperson' etc.
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

ailgm

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
  • Drupal solution provider
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.15
  • MySQL version: 5.0.89
  • PHP version: 5.2.9
Re: Adding custom fields to group entries
October 22, 2011, 06:54:47 pm
Thanks for the idea.

That way seems to have several limitations, such as:
  • having to set up a fake contact for each such group you want,
  • having to use a single relationship (e.g. "member of") to be able to set up a smart group corresponding to each fake contact (to be able to have that list be a group that can be part of other groups),
  • not being able to manage entries in the same way as other group entries and
  • that the description/notes and (custom relationship field) order # is tied to the relationship, not the group membership.
It would be so much cleaner to be able to extend the group entry.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Adding custom fields to group entries
October 23, 2011, 11:59:53 am
In my situation, there is no 'fake' contact as the organisation is important too.....it is very possible that in your situation this is a 'fake' contact. If you want to use your suggested group approach, you will have to do something like this:
  • create your own table in the civicrm database, e.g. civicrm_group_extra
  • use the buildForm hook or the <template>.extra.tpl functionality to add data to the forms you want the data on and to retrieve the data (you might want to create your own API)
  • use the postProcess hook to store data in your table
Obviously you can also get a CiviCRM developer to do this for you?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Adding custom fields to group entries

This forum was archived on 2017-11-26.