Siebel Developer's Reference > Operators and Expressions > Expressions >

How Siebel CRM Handles Data Types During a Calculation


The Type property of a field specifies the data type. A multivalue field gets the data type from the source field. Siebel CRM can convert some types to another type during a calculation. Some operations might create different results with different types. For example, "10" + "10" creates "1010", while 10 + 10 creates 20.

An item that occurs first in a calculation possesses a higher precedent. For example, "10" + 10 creates the following result. Siebel CRM converts the argument that is to the right of the operator to a string:

"1010"

For example, 10 + "10" creates the following result. Siebel CRM converts the argument that is to the right of the operator to a number:

20

The Type property of a field can contain one of the following values. The user cannot query a DTYPE_NOTE field:

  • DTYPE_BOOL
  • DTYPE_CURRENCY
  • DTYPE_DATE
  • DTYPE_DATETIME
  • DTYPE_ID
  • DTYPE_INTEGER
  • DTYPE_NOTE
  • DTYPE_NUMBER
  • DTYPE_PHONE
  • DTYPE_TEXT
  • DTYPE_TIME
  • DTYPE_UTCDATETIME

How Data Type Affects Order of Precedence

If the Calculated Value property references more than one field value, and if these fields use different data types, then the order of the data types can affect the calculation. For example, the Quote Item business component includes the Line Total calculated field. This field uses the following calculated value:

[Item Price] * [Quantity]

where:

  • The data type of the Item Price field is DTYPE_INTEGER.
  • The data type of the Quantity field and the Line Total field is DTYPE_CURRENCY.

In this example, if Item Price is 2.25, and if Quantity is 5, then Siebel CRM sets the Line Total to 11.25.

Assume you modify the calculated value of the Line Total field to the following:

[Quantity] * [Item Price]

In this example, if Item Price is 2.25, and if Quantity is 5, then Siebel CRM sets the Line Total to 11.00.

Siebel Developer's Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.