Expression syntax

You can use a syntax to Structured Query Language (SQL) to create your expressions. However, the syntax you use has additional variables.System Syntax

The expression syntax of this system uses a colon (:) to define a variable. The system uses this syntax to avoid ambiguity when you create expressions that relate to the current record (business object) or to a specific record. For example, you can have subselect in the expression, such as:

exists (select 1 from workorder where wonum=:wonum)

The first ‘wonum’ is the ‘wonum’ attribute on the ‘workorder’ object. At run time, the system replaces the second ‘wonum’ with the value of the ‘wonum’ attribute for the current business object.

Replacement Variables

Syntax

Description

Comments

:yes

true

Logically true, 1 if stored in the database

:no

false

Logically false, 0 if stored in the database

:&date&

Current date

 

:&datetime&

Current date/time

 

:&user&

Logged in user

For example, if a user is signed in as Smith:

:owner.id=&user& converts to :ownerid='SMITH'

:&personid&

Person ID of the logged in

For example, if a user is logged in as Smith:

:reportby=&personid& converts to :reportby='SMITH'

:&appname&

Application name

For example, in the Work Order Tracking application:

 ':&appname& = WOTRACK' converts to 'WOTRACK = WOTRACK'

Note: This 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:

 'object  = :&mboname&'  converts to 'object = WORKORDER'

:&ownername&

Name of the owner business object

For example, in the Work Order Tracking application:

:&owner&.jobplan.priority>&owner&.priority converts to workorder.jobplan.priority>workorder.priority

Bind Variables

Syntax

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

Note: 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 ‘old’ value will be 1.

See also

Sample Expressions