Postgresql Can not add/edit Boolean If select Tag used

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
kirondedshem
User
Posts: 642

Postgresql Can not add/edit Boolean If select Tag used

Post by kirondedshem »

HI all,
AM using latest ASP.NET maker 2018
database paostgresql
example of table structure
CREATE TABLE IF NOT EXISTS employee_contract_information (
id varchar(50) PRIMARY KEY NOT NULL,

contract_type varchar(50) ,

is_consultant BOOLEAN ,

);

Also I have not customisations on this table whatesoever

When I setup above table, BY default it will choose checkbox as default edit tag for "is_consultant BOOLEAN", it even sets user select options for it as [1=Yes, 0=No] which is ok, when I generate both Add & edit page works fine.

BUT Then I change the edit tag to use Select (mainly because I want user to see the Yes or No labels which is not available when using checkbox) and I sometimes edit the Yes or No labels to oother proper descriptions.

Now when I generate the add & edit page. I cant save anymore, since It generates exeception "An unhandled exception occurred while processing the request.
FormatException: String was not recognized as a valid Boolean.".

How I noticed this is if I leave all boolean controlls to checkbox everything works by when I change them to selects even if its only one of them, it generates above error

NOTE: I know the db is ok,coz I was using alot of similar dbs in phpmaker and set to select as well and I dont have the same problem.

I tracked it down to the line "int result = command.ExecuteNonQuery();", I tried to enable debug mode to see the query but since it fails before it wont show me the insert sql like it normally does for successfull inserts, It shows the exception isntead, so I dont know how the value looks in the query.


kirondedshem
User
Posts: 642

Post by kirondedshem »

In fact another problem is If I leave it to checkbox and it ticked to be required, user has to always select the yes option, yet while I was in phpmaker setting it as select box would still allow me to pick either yes/no fi required is set.
SO I really need to it to able to use select


Webmaster
User
Posts: 9425

Post by Webmaster »

If it is a NOT NULL field:

  1. Uncheck Tools -> Advanced Settings -> Validate NOT NULL fields
  2. Uncheck the Required setting for the field

You should then be able to use the field as CHECKBOX or RADIO


kirondedshem
User
Posts: 642

Post by kirondedshem »

If it is a NOT NULL field/.

  1. Uncheck Tools -> Advanced Settings -> Validate NOT NULL fields
  2. Uncheck the Required setting for the field
    -It has required set on edit tag
    Actually it is NUllable in the db, I want to detect when a customer has not selected anything, I want it to save null value if not selected (which null value is only available as the "select option" item in select tag).

You should then be able to use the field as CHECKBOX or RADIO
It is already working when am using a CHECKBOX (which it is set to by default).
BTW changing it to RADIO does not work either.

#I want to use Select edit tag so the user can see the labels in the user selectable options I have set for true or false.

HINT: I know I can change it to a varchar and I impliment the states well, But am concerned about why i can use select tag for boolean in phpmaker and why its failing here


Webmaster
User
Posts: 9425

Post by Webmaster »

If you are a registered user, update to the latest template (Tools -> Update Template) and try again.


kirondedshem
User
Posts: 642

Post by kirondedshem »

Thanks it works fine now


Post Reply