1. Tracy Lamb
  2. PowerBuilder
  3. Wednesday, 19 September 2018 14:32 PM UTC

Usually, my dw checkbox edit style has  data value 'T' for ON and  'F' for OFF.  I've recently been asked to add a 3rd state that sets the database value to NULL.  What do I put for a value?

I changed the 3rd state edit style value to SetNull().  This worked in one dw yesterday (I thought).  So today I'm screaming through my code to edit the other dw's that are affected.  On the very first one, I'm getting an error: checkbox1 does not pass validation test

I get the same problem if I just leave ithe 3rd state data value alone, it defaults to 0 I think.

Any ideas what may be going on here and how I can set the value to NULL for the 3rd state?

TIA,

Tracy

Philippe PILAT Accepted Answer Pending Moderation
  1. Wednesday, 19 September 2018 15:15 PM UTC
  2. PowerBuilder
  3. # 1

Tracy,

maybe you have code somewhere to validate content of the column not allowing null value ?

I've done a simple test with a DW that has a column with a 3-state checkbox and a button.

Script in the button clicked event :


STRING ls_null
SetNull(ls_null)

CHOOSE CASE dw_1.GetItemString(1, "state")
 CASE "T"
  dw_1.SetItem(1, "state", "F")
  
 CASE "F"
  dw_1.SetItem(1, "state", ls_null)
  
 CASE ELSE
  dw_1.SetItem(1, "state", "T")
  
END CHOOSE
  

No validation error generated ...

 

Regards, Philippe.

Comment
  1. Tracy Lamb
  2. Wednesday, 19 September 2018 16:12 PM UTC
Stupid question, but where is the Required property for columns set? I'm not finding it anywhere in the DW painter.
  1. Helpful
There are no comments made yet.
Philippe PILAT Accepted Answer Pending Moderation
  1. Wednesday, 19 September 2018 14:51 PM UTC
  2. PowerBuilder
  3. # 2

Hi Tracy,

use null! for Other state

 

HTH.

Regards, Philippe.

Comment
  1. Tracy Lamb
  2. Wednesday, 19 September 2018 14:59 PM UTC
I tried that, too. It's fine in the DW painter. But then during runtime, I get the same error when I try to change the checkbox state: CheckBox1 does not pass the validation test.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.