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 CiviContribute (Moderator: Donald Lobo) »
  • Custom Contribution Field Not "Defaulting" when Contribution is Made
Pages: [1]

Author Topic: Custom Contribution Field Not "Defaulting" when Contribution is Made  (Read 804 times)

YMNathaniel

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 1
Custom Contribution Field Not "Defaulting" when Contribution is Made
June 09, 2009, 07:16:20 am
To meet some internal procedural needs, I added a simple Yes/No custom field to Contributions and made the default "No." As we go through our process that is later switched to "Yes."

However, when an online contribution is made, the value is "blank" from the best I can tell. Neither "Yes" or "No" is selected, so when I perform a search to find all "Yes" or "No" values, none of the online contributions show up.

Please help? How can I get this field to automatically default to "No" when online Contribution is made? I'm open to all suggestions, including using a new field type if necessary...

We're utilizing Drupal with CiviCRM 2.2.2. 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: Custom Contribution Field Not "Defaulting" when Contribution is Made
June 09, 2009, 07:55:35 am

I'm assuming this field is not being exposed in the online contribution page

custom data is only created when a value is set, hence you see a value of blank / null

you should implement the postProcess hook on the contribiution confirm form and write the no value to the custom value table. You'll need a fair amount of php/mysql knowledge to do so

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 CiviContribute (Moderator: Donald Lobo) »
  • Custom Contribution Field Not "Defaulting" when Contribution is Made

This forum was archived on 2017-11-26.