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) »
  • Pre populating a field in a Contribution Profile
Pages: [1]

Author Topic: Pre populating a field in a Contribution Profile  (Read 1187 times)

Cid.chad

  • Guest
Pre populating a field in a Contribution Profile
February 22, 2009, 06:30:39 pm
I have attached a profile to a contribution for a membership type.

I have a Membership Id field which must be prepopulated once the membership is approved. (in two ways,
1- Online payment, 2- when the person is sending check and admin staff are changeing the membership status to Current)

How can I create a readonly field in a Profile which is pre-populated by system.

We have certain formula for the membership ID. I want the system to automatically give the membership number which is visible to user when they check their profiles.

I know that I need to do some coding, but dont know where to start from.

Thanks in Advance
Cid.

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: Pre populating a field in a Contribution Profile
February 22, 2009, 07:29:50 pm

Check: http://civicrm.org/node/356

create a custom code field and then include it in your profile. Implement the hook to generate a membership ID

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

Cid.chad

  • Guest
Re: Pre populating a field in a Contribution Profile
February 22, 2009, 08:27:30 pm
if I get it right, instead of having a PHP code custom field, it is a hook which can be used for ANY type of Custom fields.

So, everytime this hook is trigger , I have to seach for a particular custom field which can be any of the custom fieds, and then prepopulate the value. right?

It may be a very basic question, sorry, I am new, but when does this hook is triggered?


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: Pre populating a field in a Contribution Profile
February 23, 2009, 09:22:08 am

this hook is triggerred whenever we need to update / create a new entry in the custom value table for that contact / membership

so works best in conjunction when u r collecting other custom data for that contact. If that is not applicable, you can also use the membership hook to create the custom membership id

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) »
  • Pre populating a field in a Contribution Profile

This forum was archived on 2017-11-26.