Data Types in Expression BuilderThis topic describes the data types in Oracle CRM On Demand, and how they are used in Expression Builder. NOTE: The language-independent field names and the field-name syntax used in any example expressions in this topic are the field names and the field-name syntax that were used in Expression Builder in releases earlier than Release 29 Service Pack 1. These examples are still valid. However, if you select the corresponding fields for an expression from the Fields list in Expression Builder in Release 29 Service Pack 1 or later, then the field names and the field-name syntax will be different from those shown in the examples. It is recommended that you always select the fields for your expressions from the Fields list in Expression Builder, so that the field names and the field-name syntax are always correct. For more information about the field names and the field-name syntax in expressions, see About Expressions. Data Types in Oracle CRM On DemandThe 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 [{FieldName}] syntax or the [<FieldName>] syntax.
Data Type ArithmeticWhen 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:
Related TopicsSee the following topics for related Expression Builder information: |
Published 6/21/2021 | Copyright © 2005, 2021, Oracle and/or its affiliates. Legal Notices. |