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 Field Auto Number
Pages: [1]

Author Topic: Custom Field Auto Number  (Read 1011 times)

sggreener

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 0
    • The SpatialDB Advisor
  • CiviCRM version: 4.6.15
  • CMS version: Joomla 5.5.1
  • MySQL version: 5.6.29
  • PHP version: 5.3.8
Custom Field Auto Number
August 06, 2012, 05:16:22 am
Is it possible to create a custom field that is auto-numbered?

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Custom Field Auto Number
August 06, 2012, 05:58:24 am
You mean like the auto-incrementation in MySQL? Not as far as I know.
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

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 Field Auto Number
August 06, 2012, 08:07:44 am

pretty sure mysql allows only one auto-increment field per table and that is used by the column 'id' which is added for all tables as a civicrm convention

You can use that column or potentially create a column and use a mysql trigger to populate that column from '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

sggreener

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 0
    • The SpatialDB Advisor
  • CiviCRM version: 4.6.15
  • CMS version: Joomla 5.5.1
  • MySQL version: 5.6.29
  • PHP version: 5.3.8
Re: Custom Field Auto Number
August 06, 2012, 11:23:53 pm
Thanks all for replying. You have confirmed that I will need custom code to do what I want.
regards
Simon

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Custom Field Auto Number

This forum was archived on 2017-11-26.