Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I was wondering if there is a way to change a variable when the CLEAR button is clicked?
I have some date buttons that change colour when selected. they are blue but when one is clicked it changes to red (just so the user can see which date selection is active). When i clear selections the button still stays red.
Can anyone help me please?
Thanks
You can request your selections in variables e.g. with GetFieldSelections(), GetSelectedCount() or GetCurrentSelections().
- Marcus
Hi Marcus,
Thanks for your reply, but i don't know what you mean..
I want to change a variable value when the clear selections button is clicked.
If a user selects the 'Month to Date' button, this changes a vDateSelection variable to MTD which then turns the button RED.
When the clear selections button is clicked the variable obviously still reads MTD which means the button is still red.
I want to remove the MTD value from the variable.
Does that make sense?
You can use a Document Event Trigger (OnAnySelect) and add a Set Variable action for a variable with the following value ...
=if(IsNull(GetCurrentSelections()),'',1)
flipside
Hi Flipside,
Thanks thats what i wanted, the only thing is...
I always have a selection on a field called (BranchView), how would i add this to the formula you gave.
So the current selections will never be empty, there will always be a vlue in 'BranchView'
thanks
If you want not clear all fields, you can use GetFieldSelections() or GetSelectedCount() - probably in combines - in the way how flipside suggested.
- Marcus
This might work (based in this case on a field called 'Region') ...
=if(
Trim(Replace('Region: ' & GetFieldSelections(Region),GetCurrentSelections(),''))='','',1)
... or if the field can be unselected you might need ...
=if(
Trim(Replace(Replace('Region: ' & GetFieldSelections(Region),GetCurrentSelections(),''),'Region:',''))='','',1)
flipside
hi Flipside,
i have tried this ..
=if(
Trim(Replace('BranchView: ' & GetFieldSelections(BranchView),GetCurrentSelections(),''))='','',1)
but it doesnt seem to work unless all selections are cleared.
do you have any ideas?
Put the formula in a textbox and look on the result - perhaps any sign is left (CRLF).
Hmm, bit of a tricky one - have you got anything else setting the same variable based on selections?