Dependent Visibility based on Difference of Two Fields

Bear with me, this seems like a doozy. 

I want a required dropdown field to appear ONLY if two currency fields do not match. 

Field one: Suggested Library Price

Field two: Library Amount

Suggested Library Price is a calculated currency field:

ifElse(
or(
equal($librarytype_c,"AcademicUW"),
equal($librarytype_c,"AcademicPrivate"),
equal($librarytype_c,"AcademicTech"),
equal($librarytype_c,"AcademicOther")
),
add(0,$wilsprice_c),
ifElse(
greaterThan($wilsprice_c,20000),
add(1000,$wilsprice_c),
multiply(1.05,$wilsprice_c)
))

Library Amount is a currency field that we manually enter an amount in.

I can't figure out how to formulate this visibility/required dependency. I initially created yet another field (Difference of Library Amounts / new_suggested_lib_diff) to calculate the difference, and the dependency for "DOUBLE CHECK PRICES" (dropdown) is visible if "Difference of Library Amounts" is not equal to zero. But even if the difference IS zero, it is still appearing?

Difference of Library Amounts (new_suggested_lib_diff) calculation:

ifElse(
equal($coop_subscription_c,"WSDLC"),
"0.00",
subtract($amount,$suggestedlibraryprice_c)
)

This is the visibility formula for DOUBLE CHECK PRICES:

not(
equal($new_suggested_lib_diff_c,"0.00"
)
)

But clearly below, the difference IS zero, so why is the "DOUBLE CHECK PRICES" field still appearing?

Parents
  • Hi  ,

    I'm glad you were able to find a solution to your issue! If you want, you can remove the need for your intermediate calculation field by updating the visibility formula to compare your two currency fields. The visibility formula should look like this:

    Fullscreen
    1
    2
    3
    4
    5
    6
    not(
    equal(
    $amount,
    $suggestedlibraryprice_c
    )
    )
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    If the value of coop_subscription_c should also be considered when choosing to display your dropdown field, the visibility formula should wrap both conditions in an and() formula like this:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    and(
    equal(
    $coop_subscription_c,
    "WSDLC"
    ),
    not(
    equal(
    $amount,
    $suggestedlibraryprice_c
    )
    )
    )
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I hope this helps!

    Chris

Reply
  • Hi  ,

    I'm glad you were able to find a solution to your issue! If you want, you can remove the need for your intermediate calculation field by updating the visibility formula to compare your two currency fields. The visibility formula should look like this:

    Fullscreen
    1
    2
    3
    4
    5
    6
    not(
    equal(
    $amount,
    $suggestedlibraryprice_c
    )
    )
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    If the value of coop_subscription_c should also be considered when choosing to display your dropdown field, the visibility formula should wrap both conditions in an and() formula like this:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    and(
    equal(
    $coop_subscription_c,
    "WSDLC"
    ),
    not(
    equal(
    $amount,
    $suggestedlibraryprice_c
    )
    )
    )
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I hope this helps!

    Chris

Children
No Data