Conditional expression syntax
You enter conditional expressions using a syntax similar to Structured Query Language (SQL) with some additional variables.
When you create a conditional expression, use a colon (:) to define a variable. The colon is used to avoid ambiguity when you create expressions that relate the current record to a different, specific record.
You can have subselect in an expression,
exists (select 1 from workorder where wonum=:wonum).
The first wonum is the wonum attribute on the work order object. At run time, the second wonum is replaced with the value of the wonum attribute for the current record.
Replacement variables
| Replacement variable | Syntax | Description | Comments |
|---|---|---|---|
:yes |
true | Logically true | The system stores this as 1 in the database |
:no |
false | Logically false | The system stores this as 0 in the database |
:&date& |
Current date | ||
:&datetime& |
Current date and time | ||
:&user& |
Logged-in user | For example, if a user signs in as Smith, the system converts
:owner.id=&user& to :ownerid='SMITH' |
|
:&personid& |
Person ID of logged-in user | For example, if a user logs in as Smith, the system converts
:reportby=&personid& to :reportby='SMITH' |
|
:&appname& |
Application name | For example, in the Work Order Tracking application, the system converts
:&appname& = WOTRACK to WOTRACK = WOTRACK. This variable
is useful for setting different behavior for different copies of an application. |
|
:&mboname& |
Name of the current business object | For example, in the work order object, the system converts object =
:&mboname& to object = WORKORDER |
|
:&ownername& |
Name of the owner business object | For example, in the Work Order Tracking application, the system converts
:&ownername&.jobplan.priority>&ownername&.priority to
workorder.jobplan.priority>workorder.priority |
Bind variable syntax
Besides :fieldName, bind variables can use Maximo relationships, nested
relationships, refer to an old value, and reference the owner object.
| Bind variable | Description | Examples |
|---|---|---|
:<relationshipname>.<attrname> |
Value of an attribute of a related business object of the current business object | :location.description |
:&owner&<attrname> |
Value of an attribute of the owner business object | When you apply a job plan to a work order, the system copies the priority of the job plan to
the child work order. The condition can be:
:&owner&.jobplan.priority>:&owner&.priority. In this example, the
system copies this information if the job plan has a higher priority than the parent work
order. |
:&owner&.<relationship_name>.<attrname> |
Value of an attribute of the related business object of the owner business object | See the example for :&owner&.<attrname> |
:&old_<attrname> |
The initial value from the database of the attribute | For example, if you change the value of a field from 1 to 2 to 3 to 4, the original value is 1. |