Print      Open PDF Version of Online Help


Previous Topic

Next Topic

About Expressions

An expression is a valid combination of one or more operators, functions, fields, and literals that can be evaluated by CRM On Demand. This topic provides information about conditional expressions and validation expressions.

Conditional Expressions

A conditional expression is an expression that, when evaluated by the application, always returns a Boolean value such as True or False. Note that Yes, No, Y, and N are not Boolean values.

An expression used in any of the following contexts must be a conditional expression:

  • To specify a field validation rule
  • To specify a condition in a workflow rule
  • As the first parameter in an IIf function

Validation Expressions

Validation expressions are used to ensure that the data entered in fields is valid. A validation expression must be a conditional expression.

NOTE: A validation expression for a field is evaluated when the record is created, and each time the field is updated by a user.

A validation expression is different from other types of expressions in that it can start with a conditional operator. For example, if Account Name is the field being validated by the expression, the expression can start with:

= 'Acme Hospital'

This expression, though not well formed, will pass a syntax check, because CRM On Demand inserts the name of the field being validated before the expression if it does not find a field name at the start of the expression. You can also enter the validation expression as follows:

[<AccountName>]= 'Acme Hospital'

where [<AccountName>] is the field being validated.

If the expression requires other fields to be evaluated in addition to the field being validated, it is standard practice for the first comparison in the expression to be performed on the field being validated.

Validation expressions are used only in the Field Validation text box in advanced field management in Siebel CRM On Demand.

Validation Expression Examples

Example 1: A business process requires that the close date of an opportunity must be later than the created date of the opportunity.

To implement this process, create a validation expression for the Close Date field (in the Field Setup page for opportunities) as follows:

> [<CreatedDate>]

Alternatively, you can use the following example, but note that the field that is being evaluated (Close Date) must be the first field in the expression:

[<CloseDate>] > [<CreatedDate>]

For information about creating and editing fields, see Creating and Editing Fields.

Example 2: A business process requires that the revenue of an opportunity must be a nonzero value when the probability of the opportunity is 40% or greater.

The business rule indicates that the dependency is on both fields and can be restated as follows:

For an opportunity, revenue cannot be zero when the probability is greater than or equal to 40. Conversely, the probability cannot be greater than or equal to 40 if the revenue is zero.

A validation expression for a field is evaluated when the record is created, and each time the field is updated by a user. Because an update to either the Probability field or the Revenue field can affect both fields, you must have validation rules on both the Probability field and the Revenue field to implement the business rule correctly. (For information about creating and editing fields, see Creating and Editing Fields.)

The steps required to implement this example are as follows:

  1. Configure the following validation rule for the Probability field:

    < 40 OR ([<Probability>]>= 40 AND [<Revenue>]> 0)

    Note that you do not use the percentage sign (%).

  2. Add a validation error message such as the following to the Probability field:

    Revenue must be greater than 0 when the probability is greater than or equal to 40%.

  3. Configure the following validation rule for the Revenue field:

    (> 0 AND [<Probability>]>= 40) OR [<Probability>]< 40

  4. Add a validation error message such as the following to the Revenue field:

    Revenue must be greater than 0 when the probability is greater than or equal to 40%.

Related Information

See the following topics for related Expression Builder information:


Published May 2008