I put a button on the layout to setup a flag field and use the conditional formatting to change the color of the button from blue to red ifs the flag is 0 or 1.
The filed is set as number and auto enter a calculation off the value of 0 and I Check the do not replace the value.....
The script that changes the value when the button is pressed is:
If [ getfield ( FICHA TECNICA::flag) = 0]
set field [FICHA TECNICA::flag; 1]
set field [FICHA TECNICA::flag; 0]
The problems is that the filed has the value of 0, but it keep going to the else part of the if....