Previous Topic: DateNext Topic: List (QREL/BREL)


SREL

The SREL data type represents an SREL (Single RELation), which is a pointer to another object. It is a foreign key to another table in a database. For example, an Issue object has a pointer attribute to a Contact representing the Assignee.

Most CA SDM Web Services methods permit dot-notation to retrieve information about objects to which an SREL points. For example, to specify the name of a Contact’s organization from the context of the Contact, use the following:

organization.name

You may expand to an arbitrary number of levels as shown in the following example:

organization.contact.first_name

Dot-notation can only be used to retrieve attribute values, such as using getObjectValues(), or in a Where clause. You cannot use dot-notation to set values.

To set an SREL attribute, such as with updateObject(), you can pass the persistent id of the object to which you want to point. In order to simplify this action, this release of CA SDM has been enhanced so that the REL_ATTR (foreign key) value may be used to set an SREL.

For example, as the REL_ATTR of the crt object (Request Type) is its code attribute, the values “R”, “I” and “P” can be used to set the type attribute of a cr object to specify that the ticket is a Request, Incident or Problem. The cr’s type attribute can be set to “R” instead of “crt:180”, “I” instead of “crt:182” and “P” instead of “crt:181”.

To set an SREL attribute to null, pass the empty string (“”).