=============
Common fields
=============

All items that have access to the data have common fields. They are defined in 
the group they belong to. For example all catalog items have common fields 
defined in the catalogs group.


.. image:: /programming/_images/common_fields.png
	:align: center
	:alt: Common fields

Two fields are common for all items. They are **id** and **deleted** fields.

The **id** field stores a unique identifier for each record in the database table
associated with the item. This value is automatically generated by the framework 
when inserting a new record into the table.

The **deleted** field is used as a deletion flag. When the 'Soft delete' 
check-box is checked in the 
:doc:`Item Editor Dialog </admin/items/item_editor_dialog>`, 
the delete method does not 
erase a record physically from the table, but uses this field to mark the record 
as deleted. The open method takes this into account when the SQL query is 
generated to get records from the database table. 

The tables have two more fields — **owner_id** and **owner_rec_id**. They are 
used to link detail records to the a record in master table, see
:doc:`Details <details>`.

