Condition fields to amounts

Hello

I'm new to Sugar.

I solicit your help on my problem below.

I have a field A, a field B, a field C and a field D which are in currency.

1) I would like field B not to appear if field A is greater than 0 and if field D remains at 0 (formula to be entered once the “dependent” box is checked).

2) Conversely, I'd like field C to appear if field A is filled in.

What would the formula be? I know how to do it when lists are present with isinlist, but not with amounts.

Thanks in advance for your help :)

Parents
  • Hey  

    Welcome to Sugar! Glad you are jumping right in. This one is kind of tough! I think I have a working example if you would like to test and then you can share any changes you might want to implement. 

    First, I have four currency fields with a default value of 0.00 and they are called:

    currencya_c
    currencyb_c
    currencyc_c
    currencyd_c

    In currencyb_c > Visible If formula:

    ifElse(and(greaterThan($currencya_c,0),equal($currencyd_c,0.00)),false,true)


    ifElse(condition, value to return if condition is true, value to return if condition is false). In the condition part, we check to see if Currency A is larger than 0 AND if Currency D is equal to 0.00. If that condition is true, we return the condition after which was False - meaning it won't show. If that condition is false, then it will give the third value of that formula, "true", meaning that it will be visible. 

    Now for Currency C, I used this formula:

    ifElse(or(greaterThan($currencya_c,0),greaterThan(0,$currencya_c)),false,true)


    If Currency A is greater than 0, or 0 is greater than Currency A (just in case it can be negative), then we return false - meaning this field won't show. If Currency A = 0.00 (nothing changed), then Currency C will be visible. 

    New record where everything is 0.00:



    Where A > 0 and D = 0.00:


    Currency B and C are hidden. Then if we add a value to D, B will now be visible:



    Let me know if this works for you! Would be more than willing to dive back in to make any changes.

    -casey

Reply
  • Hey  

    Welcome to Sugar! Glad you are jumping right in. This one is kind of tough! I think I have a working example if you would like to test and then you can share any changes you might want to implement. 

    First, I have four currency fields with a default value of 0.00 and they are called:

    currencya_c
    currencyb_c
    currencyc_c
    currencyd_c

    In currencyb_c > Visible If formula:

    ifElse(and(greaterThan($currencya_c,0),equal($currencyd_c,0.00)),false,true)


    ifElse(condition, value to return if condition is true, value to return if condition is false). In the condition part, we check to see if Currency A is larger than 0 AND if Currency D is equal to 0.00. If that condition is true, we return the condition after which was False - meaning it won't show. If that condition is false, then it will give the third value of that formula, "true", meaning that it will be visible. 

    Now for Currency C, I used this formula:

    ifElse(or(greaterThan($currencya_c,0),greaterThan(0,$currencya_c)),false,true)


    If Currency A is greater than 0, or 0 is greater than Currency A (just in case it can be negative), then we return false - meaning this field won't show. If Currency A = 0.00 (nothing changed), then Currency C will be visible. 

    New record where everything is 0.00:



    Where A > 0 and D = 0.00:


    Currency B and C are hidden. Then if we add a value to D, B will now be visible:



    Let me know if this works for you! Would be more than willing to dive back in to make any changes.

    -casey

Children
No Data