Properties
SmartObject properties are the attributes that define the object, like columns in a spreadsheet or fields in a database table. They store items that define a record, like First Name, Last Name, Social Security Number, Department and so on. You can manually create properties or you can use a service to retrieve properties from external data sources through to a SmartObject, and use those line of business (LOB) properties directly in workflows, forms, views, and reports.
The type of SmartObject you design determines the service that your SmartObject is based on:
- SmartBox SmartObject: A SmartObject containing properties and predefined methods based on local storage in the K2 database.
- Advanced SmartObject: Allows you to create a SmartObject from one or more services, including SmartBox, and to customize the methods.
The following property types are available when you create a SmartObject property:
Type | What it is |
---|---|
AutoGUID | Similar to Autonumber, AutoGUID is an identity type where a GUID is auto-generated when a record is created |
Autonumber | When a new record is created in the SmartObject, an index number is automatically generated |
Date | Allows you to set a property to display data in a date format |
Date Time | Allows you to set a property to display data in a date and time format |
Decimal | Allows you to enter decimal numbers in the SmartObject property |
File | Stores a file of supported types |
GUID | Global Unique Identifier |
Hyperlink | Stores the property data as a hyperlink. See Use the SmartObject hyperlink property to navigate to a URL for an example of using this property to navigate to a URL. |
Image | Stores an image of supported types. See How To: Attach Images in Emails for an example of attaching an image to an email. |
Memo | Large String |
Multivalue | Use multivalue data types to store multiple values in one SmartObject property. When you use service objects that have multivalue properties, such as the Active Directory service object, the values are translated to the XML schema provided below . If the format cannot be translated, the data type is not stored. An example of the expected schema is: <collection> <object> <fields> <field> <value>2</value> </field> <field> <value>4</value> </field> <field> <value>6</value> </field> </fields> </object> </collection> The multivalue data type is typically used with a Check Box List control in views. This reads and updates the values from the multivalue property. The values shown in the Check Box List can be either static values or SmartObject list results. |
Number | Allows you to input numerical values |
Text | Stores ANSI standard text characters |
Time | Allows you to set a property to display the data in a time format. |
Yes/No | Boolean type property |
Use the information below to determine where and when to use the following data types:
- DateTime - Allows you to specify a Coordinated Universal Time (UTC) that shows the time in the local timezone.
- DateTime (with timezone) - Allows you to use a UTC time that does not vary based on the local timezone, see configuring a time zone
- Date - You can use this for a timezone-invariant date (no time).
- Time - You can use this for a timezone-invariant time (no date).
You can configure settings that further define the SmartObject properties. The types of settings depend on the property type you edit. This means that not all settings are available on all property types. Follow the steps below to configure the property settings.
Some of the additional property settings such as Maximum Size, Time Precision, and Constant Size only apply to SmartBox SmartObjects. Other line of business systems might not support the property settings as described in the table below. When a SmartObject is a SmartBox object, several property settings may only be changed when there is no data in the SmartBox SmartObject. If there is data, you may be blocked when trying to save the changes. If that is the case, you must export data from the SmartObject, delete that data, update the SmartObject, and then import the data back.
- From the K2 Designer, select the SmartObject and click Edit.
- Select the property and click Edit.
- The Edit Property page shows.
- Autonumber (auto-indexed)
- Autoguid (auto-indexed)
- File
- Image
- Memo
- Multivalue
- The Key setting is selected (auto-indexed)
- The Unique setting is selected (auto-indexed)
- The Encrypt setting is selected
- 1 - Minimum value
- 100 - Default value
- 200 - Maximum value
- 0 - Minimum value
- 0 - Default value
- 7 - Maximum value
- 0 - Minimum value
- 2 - Default value
- 12 - Maximum value
- Click OK to save changes made to the properties.
The following table describes the available property settings:
Setting | Applies to | Description | How to Use |
---|---|---|---|
Name | All | The name of the SmartObject property. | Type to add or edit the value |
Description | All | The description of the SmartObject property. | Type to add or edit the value |
Type | All | The data type of the property. | To change the format, select a value from the drop down. |
Key | All | Use this to set the property as a unique identifier for the SmartObject. | Check the check box to select property as the unique identifier. |
SmartBox | Advanced SmartObject | Use this to create the property in a SmartBox table. | Check the check box to create the property in a SmartBox table. |
Required | All | Use this to specify if the property requires a value before the record can be saved. | Check the check box if the property requires a value. |
Unique | All | Use this to specify that the property can only contain unique values. | Check the check box to require only unique values for this property. |
Indexed | All | Use this to improve performance when you filter a SmartBox SmartObject property or associate it with other SmartObjects. You cannot use this setting on the following property types:
This setting is disabled when: | Check the check box to create an index for this property. |
Constant Size | Text | Use this to specify if a text field has a constant size. Check this check box if the information entered into this field has a fixed number of characters, such as a social security number.
| Check the check box. |
Maximum Size | Text | Use this to specify the maximum length of text you enter into the property. For example, if you type 100 into this field, the most characters stored in the database are 100. You can increase the maximum size value even if your SmartObject contains data.
An error occurs when you decrease the maximum size value when there is data in the SmartObject. | Type a value between 1 and 200 into the field. |
Time Precision | Time | Use this to specify the time format for the property. You can specify the number of decimal places added after the seconds (hh:mm:ss.sss). Examples If you select the time precision as 0 and your input data is 08:27:34.1866667 the value shows as 08:27:34. If you select the time precision as 1 and your input data is 08:27:34.1866667 the value shows as 08:27:34.1. If you select the time precision as 7 and your input data is 08:27:34.7600000 the value shows as 08:27:34.7600000. If you select the time precision as 7 and your input data is 02:22:22.12345678 (8 decimal places) the value show as 02:22:22.1234568. Notice how only 7 decimal place show and rounding was applied. You cannot type a value greater than 7. It is possible to use the broker to set a value greater than 7, but this results in a SQL error. You cannot change the value if there is already data in the SmartObject.
| Type a value between 0 and 7 into the field. |
Decimal places | Decimal | Use this to specify the decimal format for the property. The value specifies the number of decimal places to be added. An error occurs when you type a value greater than 12. You also receive an error when you decrease the decimal value if there is already data in the SmartObject and the value is smaller than the value being set. Example: The value in the database is .3333333 (decimal places of 7) and you decrease the value to 2. You can, however, increase the number of decimal spaces as this does not represent potential data loss. For example, if the value in the database is .33 (decimal places of 2) and you increase the value to 5.
| |
Encrypt Property | Decimal, Number, Text | Use this to encrypt the SmartObject data when it is written to the database. This means, even if a nefarious user obtains copies of your database files (.mdf, .ndf, .ldf or backup files) they can not access or view any of the data unless they also have a copy of the encryption key or a security certificate. Example: You create a SmartBox HR application with a Social Security Number property and mark this property as encrypted. Should another business user connect to SQL directly, they will not see unencrypted SSNs. Ensure that your SmartObject does not contain any data or a Data Access Policy before setting the Encrypt property. | Check the check box to encrypt the property. |
When you work with Advanced SmartObjects, make sure to check the SmartBox check box to enable the additional settings.
Property types or better known as data types are automatically validated upon executing the CREATE or SAVE method on a SmartObject. For example, if you try to CREATE a new record for a SmartObject property called Mobile with a data type of type [Number], but with a value that is of type [Text], a server side message displays stating that validation has failed.