Have a Question?
< All Topics

Object Revolution: Auto-Increment Fields

This article covers a topic relation to the Object Revolution enhancement option.

Autoincrement fields are handled by the database implementing a sequence.  In order for the database to maintain this sequence, the field must have a data type of ‘int’.  The default datatype in CollectiveData for numeric fields is ‘decimal’ and would need to be converted to type int if you initially saved without having the Auto Incrementing field checked.

Depending on the data type that you originally had for the field, or if you had entered non-‘int’ data into the field previously, it may not convert over to an ‘int’ data type with a simple SQL ‘ALTER TABLE’ statement.

If this is a new field with no values in it, Then you can use the ‘Database Actions’ to get rid of the column and recreate it.
(Warning:  Dropping a column will permanently delete any data that was in that column.  Please call us if you are needing this data preserved.  Do not proceed with further instructions if you need to keep the data in this column.)


To drop and recreate the column:

  1. Set up your field with a Numeric Field type and make sure that [Auto Incrementing] is checked.
  2. Make sure that [Apply Object Properties Updates] has been pressed.
  3. Make sure that the ‘Database Server’ field matches your Database type.
  4. Change the ‘Action’ to [Drop]
  5. Press the [Generate] Button
  6. Press the [Execute] button
  7. Change the ‘Action’ to [Create]
  8. Press the [Generate] Button
  9. Press the [Execute] button
Table of Contents