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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Instantiating default for a custom data field
Pages: [1]

Author Topic: Instantiating default for a custom data field  (Read 442 times)

JulieR

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 5
Instantiating default for a custom data field
June 12, 2011, 01:02:26 pm
I created a custom data set used for Memberships.  It contains a field I call membership level, which has three multiple choice options (Associate, Member, Subscriber).  I set the default to Associate as all new members enter at the associate level (this is capturing something different to their membership type).

However, it seems that the setting 'default' only dictates which multiple choice option should be selected by default if a profile containing this field is displayed.  The value of the field is not actually being set to Associate until that profile is viewed and saved.

a) How can I get this attribute to always be set to Associate by default for new members?  Is there another way to achieve what I want?  I didn't want to use a tag as membership-level is only valid for members.

b) By now I have a lot of members with null values for this field.  Searching for members with null values and bulk editing them doesn't seem possible.  Where in the database would the value of this field be stored -- is it safe to update the null fields directly in SQL, and if so where?

Would appreciate the help!
Thanks,
Julie

JulieR

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 5
Re: Instantiating default for a custom data field
June 12, 2011, 01:35:37 pm
I've found the table, it is a custom table corresponding to my data set:  civicrm_value_general_membership_info_4.  I see that new members do not automatically get a record created in this table, but if I edit a membership, membership-level=Associate is selected by default, so if I just hit save then I find a corresponding record has appeared in the table.  So my questions become:

a) can I trigger this record to be created for all new memberships?
b) to repair the old data, can I manually enter records into this table or will I break something trigger-like if I do?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Instantiating default for a custom data field

This forum was archived on 2017-11-26.