You need to sign in to do that
Don't have an account?
GMASJ
If Condition ranges in apex
Hi,
I am confused with negative value adding in a condition This might be a simple question please suggestion
I need add below condition
Sales Ops ==> [ Between 0.99 to 25 ]
CRO ==> [Between -10.01 to 0.00 ]
CFO ==> [Between -10.00 to 25.01 ]
I tried with below condition for some reason it does seems to be right Please suggest me how to add the range condition.
Thanks
Sudhir
I am confused with negative value adding in a condition This might be a simple question please suggestion
I need add below condition
Sales Ops ==> [ Between 0.99 to 25 ]
CRO ==> [Between -10.01 to 0.00 ]
CFO ==> [Between -10.00 to 25.01 ]
I tried with below condition for some reason it does seems to be right Please suggest me how to add the range condition.
Decimal Dt = -12; If( Dt >= 0.99 && Dt <= 25.00){ System.Debug('Sales Ops'); } If( Dt >= -10.01 && Dt <= 0.00){ System.Debug('CRO or SVP'); } if( Dt <= -10.00 && Dt >= 25.01){ System.debug('CFO'); }
Thanks
Sudhir
Variable X can be greater only if the comparing value is on the left side of the line, because the range is (-inifinity < 0 < infinity).
Hope this resolves your concern, Hit kudos if you like it.
Sales Ops >= 0.99 to <+ 25.00
CRO >= -10.01 to <= 0.00
CFO <= -10.00 to >= 25.01
Example If enter
Value = 26 Only CFO must display
Value = -12 Only CFO must display
Value = 0.77 Only Sales Ops must display
Hope this clarifies Please let me know how to add this logic.
Thanks
Sudhir
Rest examples are also wrong. Seems like you might need to use "OR" operator in condition because "AND" is always going to give you FALSE with your conditions.
Thanks
Sudhir
Regards,
DevADS