cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable a button by using conditions

Former Member
0 Kudos

Hi all,

I've got a table with a field "Status" and a field with a button. If there is a value "Available" in the "Status" field

the button has to be enabled. If not it has to be disabled.

At the properties of the button I have chosen "Disabled" and entered the condition.

The condition is: 'IF(@Status == "Available",false,true)'.

But there is an error message: 'Expected boolean value/expression'.

How is the right syntax to do so?

Thanks in advance

Kind regards, Frank.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Frank,

the disabled function of the button needs a booelan value. The IF condition don't give you an boolean value, but an text value. Therefore you get the error message: 'Expected boolean value/expression'

There are two possibilities to do it an a correct way:

- BOOL(IF(@Status == "Available",false,true))

--> Bool converts a Text to a Bool-value

- @Status == "Available

--> This statment gives back a boolean

Kind regards

Thomas

Former Member
0 Kudos

Hi Thomas,

thanks for your help. The expression is now correct.

But now in each row the button is disabled even if the status is "Available".

The buttons in the rows with "Available"-status should be enabled and the buttons

in the rows with non-"Available"-status should be disabled.

It seems the test takes no effect.

Regards, Frank.

Former Member
0 Kudos

Hi,

instead of True put value 1 and instead of false put 0 value in the Expression and try now.

Regards,

Govindu

Answers (0)