IfElse returning null value

I am trying to create a calculated field in the Product Catalog. I have a custom drop down field named pricing_factor_options_c. I want another custom currency field name pricing_factor_1_amt_c to be populated with a certain amount depending on the selection from pricing_factor_options_c. Here is my calculations. This calculation does not return any errors. However, when I make any selection in the pricing_factor_options_c field on the Product Catalog the pricing_factor_1_amt_c field  returns a "false" value in red with an error message "Please complete all required fields before saving". This field is not a required field, by the way. However, when the record is attempted to be save this is the error message received.

Here is the calculation I have in the pricing_factor_1_amt_c field. What have I done wrong?

or(
ifElse(equal($pricing_factor_options_c,"Fixed Rate"),1.00,""),
ifElse(equal($pricing_factor_options_c,"Pricing Factor 1"),2950.00,""),
ifElse(equal($pricing_factor_options_c,"Pricing Factor 2"),200.00,""),
ifElse(equal($pricing_factor_options_c,"Pricing Factor 3"),25.00,""),
ifElse(equal($pricing_factor_options_c,"Pricing Factor 4"),495.00,""),
)

Parents
  • You should implement a nested ifElse instead, just like below:

    ifElse(
    equal($pricing_factor_options_c,"Fixed Rate"),
    1.00,
    ifElse(
    equal($pricing_factor_options_c,"Pricing Factor 1"),
    2950.00,
    ifElse(
    equal($pricing_factor_options_c,"Pricing Factor 2"),
    200.00,
    ifElse(
    equal($pricing_factor_options_c,"Pricing Factor 3"),
    25.00,
    ifElse(
    equal($pricing_factor_options_c,"Pricing Factor 4"),
    495.00,
    0
    )
    )
    )
    )
    )

    André Lopes
    Lampada Global
    Skype: andre.lampada
Reply
  • You should implement a nested ifElse instead, just like below:

    ifElse(
    equal($pricing_factor_options_c,"Fixed Rate"),
    1.00,
    ifElse(
    equal($pricing_factor_options_c,"Pricing Factor 1"),
    2950.00,
    ifElse(
    equal($pricing_factor_options_c,"Pricing Factor 2"),
    200.00,
    ifElse(
    equal($pricing_factor_options_c,"Pricing Factor 3"),
    25.00,
    ifElse(
    equal($pricing_factor_options_c,"Pricing Factor 4"),
    495.00,
    0
    )
    )
    )
    )
    )

    André Lopes
    Lampada Global
    Skype: andre.lampada
Children
No Data