Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I have a field called 'TransactionDate' which, when I clear it, needs to change the value of a variable, vLastWeekTrans, to 0.
I'm trying to use the current expression in the variable's 'Definition' box and am not getting any result:
=if(GetSelectedCount(TransactionDate)<1, 0,1)
Thanks in advance for any help.
In your buttons you force the value of your variable vLastWeekTrans to 1 => It's clear th definition.
Two solutions :
1. In the definition of the variable put the formula if(GetSelectedCount(TransactionDate)<1, 0,1) (without the equal sign) and nothing in the button
2. If you absolutely want the action on the button : create the variable without definition and then in each button on the action on the variable put the formula if(GetSelectedCount(TransactionDate)<1, 0,1) (without the equal sign)
It works for me
Definition of the variable if(GetSelectedCount(TransactionDate)<1, 0,1) (without the equal sign)
Thanks Sabrina,
I've tried this and, once I've updated the definition, it works (i.e. it changes the variable value). I click the button again and then clear the selection and it doesn't work.
Could there be anything that overrules the definition of a variable?
I try multiple times and it works fine for me. Could you add your app ?
I can add without data if that's ok?
Here is the app. The variable is acting on the background and font colours in the first button on the left underneath the blue banner.
In your buttons you force the value of your variable vLastWeekTrans to 1 => It's clear th definition.
Two solutions :
1. In the definition of the variable put the formula if(GetSelectedCount(TransactionDate)<1, 0,1) (without the equal sign) and nothing in the button
2. If you absolutely want the action on the button : create the variable without definition and then in each button on the action on the variable put the formula if(GetSelectedCount(TransactionDate)<1, 0,1) (without the equal sign)
This is working really well, thank you Sabrina!
I have one button that's in an alternate state and this method isn't working for that button. Is there an adjustment I need to make when dealing with variables in alternate states?
Many thanks once again.
Please see this issue : LINK
The best solution I can seem to find is the following:
if(GetSelectedCount(TransactionDate, 'WoW')<1, 0,1)
'WoW' being the name of the state. The problem is it doesn't clear when the field is cleared of selections.