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) »
  • creating random membership numbers
Pages: [1]

Author Topic: creating random membership numbers  (Read 1035 times)

kristin

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 3.3
  • CMS version: Joomla
  • MySQL version: ?
  • PHP version: ?
creating random membership numbers
February 15, 2012, 07:48:55 pm
Hello,

is it possible to have CiviCRM create a random membership numbers for each new member that signes on and to send out that number to the new member? This would be very helpful when cooperating with other foundations and brands when it comes to discounts and special offers...

Thanks a lot for any help in advance,
Kristin

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: creating random membership numbers
February 16, 2012, 09:13:53 am

1.not sure why a random number is better, however u can use either the contact id and/or the membership id (both of which are unique) as a id

2. if u do need a random number, u can create a custom field and use a hook (or a mysql db trigger) to create a value on contact or membership creation

3. Alternatively u can use the 'hash' column in civicrm_contact table. This is not a random number, but a random 32 character md5 hash

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 CiviMember (Moderator: Deepak Srivastava) »
  • creating random membership numbers

This forum was archived on 2017-11-26.