Persistence types
Persistence types enable values to be automatically generated, rather than being specified by a user. The following persistence types are available:
- CreateDateTime – specifies the date and time the record was created
- UpdateDateTime – specifies the date and time the record was updated
- CreateIdentity – specifies a unique number, for example Change ID
- CreateUser – specifies the user who created the record
- UpdateUser – specifies the user who updated the record
You can specify the persistence type for the following data types: DateTime, Int32 and Object (where the relationship is to the System | User business object).
Date and time attributes
There are two main types of date and time attributes. If you want the date and time to be generated, then you need to specify the persistence type. If you want users to be able to specify a date, for example, when a reminder is sent, or specify the date of birth of an employee, you do not need to specify the persistence type – you leave the property blank.
When you create a date/time attribute, you need to indicate whether you want to record the date and time that the record was created, or the date and time that the record was updated. The value in the date/time attribute will not change if you select the creation date/time. If you select the updated time, then the value changes each time the record is updated.
To create a date/time attribute:
- On the Business Objects tree, select the relevant business object, then on the Actions list, click New Attribute.
A new attribute appears on the Attribute tree with the default name, [New Attribute], selected. - Type a name for the new attribute, then press Enter.
- This is entered as the Title property and does not need to be unique. The Name is automatically generated from the title, removing any spaces. The name must be unique.
- On the Properties grid, alongside Data Type, select DateTime.
The Persistence Type dialog appears.
This applies only to automatically generated dates. If you want to specify a date, for example, a date of birth or due date or similar, then leave this property blank.
- Select the relevant options, then click OK.
- Complete the remaining information for the attribute.
For information about what the properties are, click the required property. Help appears at the bottom of the Properties grid.
- Click
.
Creating serial number attributes
Identity attributes are internal serial numbers, or any attribute that you want to increase automatically, without the need for user intervention. For example, you may give a serial number to each asset your company owns, or employee number, or Incident ID and so on.
To create an identity attribute:
- Create a new attribute with the Data Type of Int32.
The Persistence Type dialog appears.
This applies only to numbers automatically generated. If you want to specify a number manually, then leave this property blank. - Select the relevant options, then click OK.
- Complete the remaining information for the attribute.
- Click
.
User attributes
You can automatically record the name of the user who created or updated a specific record within your database. For example, you can record the name of the user who logged an Incident, and you can also record who added a note to that incident. This information is gained from the login information of the relevant user, and is recorded automatically. No user-intervention is required.
To create a user attribute, you need to create a relationship between the required business object and the system defined User business object.
For more information about creating relationships, see Creating relationships.
To create a user attribute:
- On the Business Objects tree, expand the relevant business object, then expand the System folder.
- Drag User to the required business object.
A relationship message box appears, telling you that a relationship has been created to access User from the related business object. You are asked if you want to access all related instances of the related business object from the User business object.
If you are creating a relationship between user and change, then you will probably choose Yes – you will want to select a user and then choose to see all of the changes associated with that user. If you are creating a relationship between user and note, however, then you will probably choose No – you are unlikely to want to select a user and then choose to see all of the notes associated with them.
- Click Yes or No as required.
The Persistence Type dialog appears. - Select the required options then click OK.
- Specify the remaining properties, then save the information you have specified.