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) »
  • Custom group fields not being pre-filled via tab
Pages: [1]

Author Topic: Custom group fields not being pre-filled via tab  (Read 1158 times)

madronemedia

  • Guest
Custom group fields not being pre-filled via tab
November 06, 2008, 01:11:14 pm
 ???
I've created a custom group for individuals with custom fields to help manage volunteer information for contacts. For the fields, I've set up default and required status for most of them. I also set up the group to be a tab versus inline. So, when I either look up an existing contact or even enter a new contact, none of the volunteer info is pre-filled. I click the volunteer info tab and each filed is listed but the default and required values are blank. I have to click the "edit volunteer info" first, then simply save to have the default values applied to the contact.

Is their a way to get the default values of a custom fields to display without having to first click the edit link?

Also, I know I can also choose "inline" versus "tab" to display the custom group. This looks like it will work for new contacts being entered to have the default and required fields displayed after saving the initial contact set-up, but it makes the page unruly. Our client prefers to have the Volunteer Info be in a separate tab. I just need you help on how to get this tab to display he field data that is marked as default and required,  without having to click the "edit" link and then save.

By the way, I also tested this in the drupal demo and get the same results...

Any help would be most welcome!


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 group fields not being pre-filled via tab
November 06, 2008, 03:07:08 pm

In the current system the view screen displays the values from the DB. The default values are set once someone saves a custom groupe etc, hence you are seeing this behavior.

I suspect the easiest way might be to write a hook to create a DB record for the default volunteer info on contact create. This will populate the database and hence the volunteer tab view screen

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

madronemedia

  • Guest
Re: Custom group fields not being pre-filled via tab
November 06, 2008, 03:24:32 pm
Just to clarify, do you mean the default values are set each time I access an existing contact or enter a new contact (after creating a new custom group), or are they set when the custom group is initially created? Could this be solved by creating custom groups in a new database prior to importing data?

thanks for you help senor lobo.

Quote from: Donald Lobo on November 06, 2008, 03:07:08 pm

In the current system the view screen displays the values from the DB. The default values are set once someone saves a custom groupe etc, hence you are seeing this behavior.

I suspect the easiest way might be to write a hook to create a DB record for the default volunteer info on contact create. This will populate the database and hence the volunteer tab view screen

lobo




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 group fields not being pre-filled via tab
November 06, 2008, 03:57:44 pm

to clarify:

custom record is created for a contact ONLY after the custom group is saved (if in tab) or when the contact is created (if inline)

if your custom group is in created/viewed via a tab, then your best bet is to create the custom record via a civicrm_post_hook on contact creation. So you will need to write some amount of code to make this happen

if you need help/assistance getting started ping us 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) »
  • Custom group fields not being pre-filled via tab

This forum was archived on 2017-11-26.