Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
autoset
Programmer's Guide > OpenAccess ORM Classic (Old API) > Programming With OpenAccess > Metadata Extension Reference > autoset

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

Configures a field to be automatically set by OpenAccess ORM when new instances and/or changes are committed. This may only be used on System.DateTime, byte, short and int fields. When used on a System.DateTime field the current time is set. When used on a sbyte, short or int field the current value of the field is incremented by one (wrapping to 0 at max positive value) or it is set to 1 for new objects. This is useful for automatically maintaining date created, date last modified and version number fields. Here is an example of using the autoset extension to fill the orderdate field:

Copy Code
<field name="orderDate">
     <extension key="autoset" value="created" />
</field>

The valid values for the autoset extension are as follows:

Autoset

Description

none

Do not autoset field (default value)

created

Set on commit when new instance is created

modified

Set on commit when existing instance is modified

both

Set on commit when instance is created or modified