Submitted by Paul_J_Miller on 2018/05/30 13:53
How do I set the default value for a Yes/No field.
 
I need this field to default to Yes unless I set it to No.
 
I have tried setting the default value field to Yes, YES, True, TRUE and -1 but whenever I create a new item this field is always blank (no) unless I click it which is the opposite of what I want.
 
This is not covered in the manual.
 

Comments

Hi Paul,
 
This is by design. You wouldn't want to set the field for all items in the database...
 
There are many ways to automatically set yes/no field though... 
- specific to a grid: look into grid properties or
- field properties - auto-assign rules
 
HTH
 
Pierre_Admin
IQ Designer
 

Paul_J_Miller

2018/05/30 16:45

In reply to by Pierre_Admin

[quote=Pierre_Admin]
Hi Paul,
 
This is by design. You wouldn't want to set the field for all items in the database...
 
There are many ways to automatically set yes/no field though... 
- specific to a grid: look into grid properties or
- field properties - auto-assign rules
 
HTH
 
Pierre_Admin
IQ Designer
 
[/quote]
 
Setting it for every item in the database was exactly what I wanted to do.  But I have a work around now.
 
Auto assignment might have caused problems, I wanted to decide if I set the field to 'No' and I didn't want the program to go changing the field after I had set it.
 
So what was the workaround you might ask ?
 
Re frame the question so that 'Yes' means no and 'No' means yes, changing the sense of the logic using the field.  But it made a very contrived question ... oh well.

If one cannot set the default value of a Yes/No field 'by design' then why is that option not greyed out for Yes/No fields to stop users wasting their time trying to set it if they don't know it's not allowed.  Some clues in the manual might help as well.
 
 
 

Pierre_Admin

2018/05/31 10:28

In reply to by Paul_J_Miller

[quote]
If one cannot set the default value of a Yes/No field 'by design' then why is that option not greyed out for Yes/No fields to stop users wasting their time trying to set it if they don't know it's not allowed.  Some clues in the manual might help as well.
[/quote]
Good point, I'll do it in the next version
 
Pierre_Admin
IQ Designer