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 CiviMember (Moderator: Deepak Srivastava) »
  • Auto-increment member numbers
Pages: [1]

Author Topic: Auto-increment member numbers  (Read 2088 times)

felixmartel

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 0
  • CiviCRM version: 3.4.7
  • CMS version: Drupal 6.31
  • MySQL version: 5.1.54
  • PHP version: 5.3.5
Auto-increment member numbers
February 21, 2011, 03:04:48 pm
Hello,

Been searching and not finding any recent discussions on this point. Is there a documented method for implementing automatically incrementing member numbers in v.3.3.5? We're looking at implementing CiviCRM. We produce member cards with member numbers.

Thanks.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Auto-increment member numbers
February 21, 2011, 09:10:24 pm
We tend to use the id from the civicrm_member table. It's fairly simple to write a bit of module to make this available to e-mails & letters you send out (I have done tokens like this for pledges & 'last 5 contributions' but not members at this stage)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

felixmartel

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 0
  • CiviCRM version: 3.4.7
  • CMS version: Drupal 6.31
  • MySQL version: 5.1.54
  • PHP version: 5.3.5
Re: Auto-increment member numbers
February 22, 2011, 04:56:26 am
What if I have existing members that already have their member numbers? I have about 400 existing accounts. I'd rather not have to renumber them all...

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Auto-increment member numbers
February 22, 2011, 02:44:19 pm
So, the existing member numbers? What are they? Where are they from?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

felixmartel

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 0
  • CiviCRM version: 3.4.7
  • CMS version: Drupal 6.31
  • MySQL version: 5.1.54
  • PHP version: 5.3.5
Re: Auto-increment member numbers
February 22, 2011, 04:55:39 pm
Four digit integer. Generated by our old java-based member application.

sjthespian

  • I post occasionally
  • **
  • Posts: 63
  • Karma: 3
    • The League of Professional System Administrators
  • CiviCRM version: 4.2.7
  • CMS version: Drupal 6.28
  • MySQL version: 5.1.66
  • PHP version: 5.3.3
Re: Auto-increment member numbers
February 23, 2011, 01:19:15 pm
I was in the same boat when I first deployed CiviCRM for our organization. I spent some time trying to write a bit of custom code to handle it, and ended up just giving up and using the contact id as the member number.

My final solution was ugly, but worked....
  • Import the data from our old member database using the CiviCRM contact import function
  • Modify the database schema constraints to allow updating the contact id and to propagate those changes to all tables (I probably still have the SQL for this)
  • Write/run a script that would update the contact id to be the same as the member number in our old system
Since the contact id is an auto incrementing field, the next user created will have a contact id greater than the highest member number in our old system.
Dan Rich <drich@lopsa.org>
    Director, LOPSA - http://lopsa.org/

felixmartel

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 0
  • CiviCRM version: 3.4.7
  • CMS version: Drupal 6.31
  • MySQL version: 5.1.54
  • PHP version: 5.3.5
Re: Auto-increment member numbers
February 23, 2011, 02:54:12 pm
Ok. Sounds like a plan. Will I be able to run searches on this contact ID ? I assume your script reset the schema to avoid people fiddling with contact numbers after the import?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Auto-increment member numbers
February 23, 2011, 03:14:36 pm
Another option is to import old membership numbers into the external_identifier field & use smarty templates like

{if 'external_identifier'}
{external_identifier}
{else}
{$contactID}
{/if}

(note all syntax off the top of my head - so probably wrong)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Auto-increment member numbers

This forum was archived on 2017-11-26.