IIfThe IIf function in Expression Builder returns one of two parameters based on the evaluation of a conditional expression. IIf is an abbreviation for Immediate If. SyntaxIIf(expr, result_if_true, result_if_false) Alternate SyntaxIIf(expr, expr_if_true, expr_if_false) Mixed SyntaxIIf(expr, result_if_true, expr_if_false) IIf(expr, expr_if_true, result_if_false) Result TypeThe result type of the IIf() function is always the type of its first argument. If the expression evaluates to FALSE, the second argument is converted to the type of the first argument before its value is returned. ArgumentsThe following table describes the arguments for the function.
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. ExamplesThe following is an example of mixed syntax in the IIf function: A business process requires that the Region field on an account detail page is to be updated when the Billing State field is changed as follows: If the Billing State field is changed to OK or TX, the region field is to be updated to Central. If the Billing State field is changed to CA, the Region field is to be updated to West. For all other states, the Region field is to be updated to East. IIf([<PrimaryBillToState>]='OK' OR [<PrimaryBillToState>]='TX', 'Central', IIf([<PrimaryBillToState>]='CA', 'West', 'East')) Related TopicsSee the following topics for related Expression Builder information: |
Published 6/21/2021 | Copyright © 2005, 2021, Oracle and/or its affiliates. Legal Notices. |