Loading...
 
Skip to main content

History: Auto-Increment Field

Source of version: 12 (current)

Copy to clipboard
            {syntax type="markdown"  editor="wysiwyg"} # Auto-increment Field / ItemId Field

tw>=2.0

The field type enables you to assign a column for an ID number to a tracker. You can either use the itemID from tiki (which counts all items in all trackers) or an ID you define using a string and a consecutive increasing numeric value.

For instance

- with a parameter: 1,File

The first item field value will be File1, the second item field value will be File2

- with a parameter: 0,,,itemId

The field value will be the itemId

## Options

| Value | Description | Tiki version |
|---|---|---|
| numeric | Initial value, default 1 | tw>2.0 |
| string | Prepend string | tw>=2.0 |
| string | Append string | tw>=2.0 |
| the string itemId | the field will contain the itemId | tw>=2.0 |

The option are separated with comma.

Since ((Tiki9)), this field can be used in ((PluginTrackerFilter)) to allow users to do custom searches of items in a tracker based also on their auto-increment field.

## Limitation

- an auto-increment field is only set up when the item is created
- an itemId field is only set up when the item is created or modified

In order to set a new itemId field on existing items. this sql query can be used 
{CODE()}
DELETE FROM `tiki_tracker_item_fields` WHERE `fieldId`=317;
INSERT INTO `tiki_tracker_item_fields` ( `itemId` , `fieldId` , `value` )
SELECT `itemId` , 317, `itemId`
FROM tiki_tracker_items
WHERE `trackerId` =54 
{CODE} 
Where 317 is your itemId field and 54 your trackerId.

## Note about ItemID before version 2.0

In later versions of the 1.9.x series, ItemID was available via ((System Tracker Field))