Data Types in Expression Builder
This topic describes the data types in Oracle CRM On Demand, and how they are used in Expression Builder.
Data Types in Oracle CRM On Demand
The following table shows the data type returned when an Oracle CRM On Demand field is used in an expression. To get the value of a field, use the syntax [<FieldName>].
NOTE: If the company administrator has renamed fields, the record type Fields list shows the new names, but the expression syntax shows the original names. For custom fields, the Integration Tag names that the company administrators can change are used in the expression syntax. The syntax is as follows:
[<CustomTag_ITAG>] and FieldValue('<CustomTag_ITAG>')
Data Type Arithmetic
When a statement references more than one field value, and the fields have different data types, the order of the data types can affect the calculation. When an operator (other than the exponent operator) is applied to two operands of two different data types, the operand on the right side of the operator is converted to the data type of the operand on the left side before the operation is evaluated. For example, if CloseDate is 02/09/2007, the following expression:
PRE('<CloseDate>') + 30
evaluates to 02/09/200730. Therefore, the following condition:
[<CloseDate>] > PRE('<CloseDate>') + 30
is syntactically valid, but its meaning is invalid. The condition is correctly written as follows:
[<CloseDate>] - 30 > PRE('<CloseDate>').
NOTE: When the exponent operator is used, the operand on the right side of the operator is not converted to the data type of the operand on the left side.
The following tables show the possible results of the various arithmetic operations, using the example values.
When the exponent operator is used, the operand on the right side of the operator is not converted to the data type of the operand on the left side.
In this example (where Quantity is an integer field, value 5, and Item Price is a currency field, value 2.25), if the operand on the right side of the operator was converted to the data type of the operand on the left side, the expected value of Quantity ^ Item Price would be 25, and the expected data type would be integer. However, the results are shown in the following table.
The negation operator (minus sign [-]) is also supported in Expression Builder. For example:
If you convert a number to a string, the calculation does not work correctly. For example:
See the following topics for related Expression Builder information:
|Published 5/4/2012||Copyright © 2005, 2012, Oracle. All rights reserved. Legal Notices.|