Object Properties
The following sections describe the possible types of custom properties you can add to an object definition.
Base Property Options
The following base options are available when defining properties, unless otherwise noted. See individual properties for additional property-specific options.
*Bold options are required*
Name | Type | Default | Description |
name | String | API name of property. | |
label | String | Property label that can be used in UI. | |
type | String | The property type. See individual property type details for more info. | |
description | String | Property description. This can be used for UI or for administrative purposes. | |
array | Boolean | false | If true, this property is an array of this type rather than a single value. This option can only be set when creating the property and cannot be changed. |
uniqueValues | Boolean | false | Applies only if |
minItems | Integer | 0 | Applies only if |
maxItems | Integer | 100 | Applies only if |
maxShift | Boolean | false | Applies only if |
canPush | Boolean | true | Applies only if |
canPull | Boolean | true | Applies only if |
writeOnCreate | Boolean | true | Applies only if |
readAccess | Integer | 4 | The access level require to read this property. See Access Control for available values. |
writeAccess | Integer | 6 | The access level require to write to this property. See Access Control for available values. |
acl | Document Array | Allows additional ACL to be specified for property. This acl merges with runtime acl to increase access to this property. Additive only -- these acl entries cannot lessen access to this property. | |
auditable | Boolean | false | When true, changes to this property will result in a record in the audit logs. |
readable | Boolean | true | Allow this property to be read. When false, this property is not available through the API and is only available through scripts. |
writable | Boolean | true | When true, this property is writable via the API. When false, this property is only writable through scripts. |
creatable | Boolean | false | When true, this property is only writable on document creation. |
removable | Boolean | false | If true, this property can be removed from a document using |
history | Boolean | false | If true, changes to this property are recorded in a history collection and made available though an |
optional | Boolean | false | If true, this property is not included in read operations unless explicitly included with the |
indexed | Boolean | false | If true, property is indexed and available for querying. There is a limit of 20 indexed properties per object. |
unique | Boolean | false | If true, the property will be guaranteed unique. This option can only be set on property definition creation. There is a limit of 5 unique properties per object. |
validators | Document Array | A list of validators applied to this property before writing. Failure to validate will result in a |
Property Validation Rules
When defining custom object properties, you can also specify validation rules to apply to your properties in the property definition validators
option. You can specify multiple validation rules for a property.
When defined, these rules are evaluated prior to properties being written. Should validation fail for a property, the entire request will fail and a kValidationError
fault will be returned for each validation error. When validations faults are returned, property paths are also returned with the faults. This is helpful when relaying validation errors to users in a client UI.
Validation rules take the form:
*Bold options are required*
Name | Type | Description |
name | String | The name of an available validator for the property. See individual property details for available validators. |
description | String | A description of the validator |
definition | Document | A document specifying validator options (if available). See individual property validators for available options. |
Last updated