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 the K2 SmartBox service (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 |
Image | Stores an image of supported types |
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.
- 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 again.
- From the K2 Designer, select the SmartObject and click Edit.
- Select the property and click Edit.
- The Edit Property page shows.
- 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. |
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. | 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.