Previous Topic: Constraint Specifications

Next Topic: Create a Data Partition Constraint for CAB Assignments

Constraint Types

You can assign the following types of constraints for each controlled table in a data partition:

Create

Specifies criteria that must be met before creating a record. When a user in the data partition attempts to create a record that does not match the create test condition, CA SDM displays the error message associated with the constraint and does not save the record.

Defaults

Specifies one or more assignment statements, separated by semicolons, defining values to be assigned to empty fields in a new record at the time the record is stored. The syntax of each assignment statement is, where att_name is the name of a Majic attribute from the record, and value can be an integer, a string enclosed in quotes, or a reference in the form @root.att_name to a Majic attribute in the contact record for the current user:

att_name=value

For tables updated for tickets, default values are placed into the record at the time it is displayed and are shown on the initial display of a new record. You can assign a default value to a reference field (a Majic SREL) by coding it in the form of a persistent ID. A persistent ID is an object name followed by a colon and an integer ID. For example, you can set a default value for category by including the following in the defaults specification, where PCAT is the target of the SREL (as shown in the Majic file) and 12345 is the ID number of the desired category:

category='PCAT:12345'

You can list persistent IDs for an object using a command of the form:

bop_odump domsrvr pcat "" sym
Delete

Specifies criteria that must be met to delete a record. When a user in the data partition attempts to delete a record that does not match the delete condition, CA SDM displays the error message associated with the constraint and does not delete the record.

Pre-Update

Specifies the records in the controlled table that a user can update in the data partition. When a user in the data partition requests a record that does not match the pre-update condition, CA SDM makes the record read-only and displays the error message defined with the constraint.

Update

Specifies criteria that must be met when a record is saved. When a user in the data partition attempts to save a record that does not match the update condition, CA SDM displays the error message associated with the constraint and does not save the record.

View

Specifies the records in the controlled table that a user can view in the data partition. This constraint is automatically applied to all lists selected by a user in this data partition, in addition to any selection criteria explicitly specified by the user.

View can include joins to other tables and references in the form @root.att_name to Majic attributes in the contact record for the current or logged-in user. Valid examples are:

requestor.organization = @root.organization
requestor.organization.name = 'MIS'
assignee = @root.id
assignee.organization = @root.organization

Note: The Create, Delete, Pre-Update, and Update constraint types now support joins to other tables. They can also include references in the form @root.attribute to attributes in the contact record for the current user.