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) »
  • set default value of custom field based on another custom field
Pages: [1]

Author Topic: set default value of custom field based on another custom field  (Read 1307 times)

chrism

  • Guest
set default value of custom field based on another custom field
October 27, 2007, 07:58:00 am
I have a custom field for Contribution records and want to set its default pull-down list value to the value of a custom field in the individual's most recent active Membership.  After looking through the developer documentation I am still not sure how to begin structuring this into the CiviCRM, Drupal architecture.  Can someone point me in the right direction to get started?

(PS. The specific need is this:  Each individual membership has a custom "Chapter" field. When membership dues are received from individuals, a custom Chapter field is populated with the chapter of their membership.  This allows tracking of membership dues by chapter.  Currently, when offline membership dues are recorded, the administrator has to look at the individual's Membership tab, remember the chapter, then go to the Contribution tab, and select the same chapter when they enter a new contribution.  )

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: set default value of custom field based on another custom field
October 27, 2007, 12:01:56 pm

You will need to hack this at:

CRM/Contribute/Form/Contribution/Main.php, function setDefaultValues( )

Set the default array right before returning to the value for that specific contactID

if you have more questions, might be best to ask them on IRC

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • set default value of custom field based on another custom field

This forum was archived on 2017-11-26.