Setting value to Boolean field using GlideRecord
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hello friends,
When i try to do below, it fails (does nothing) with string "True" whereas works well with string "False". I tried with string "true" and it worked, but want to check, why it wouldnt work with string "True".
var gr=new GlideRecord('cmdb_ci_computer');
gr.get('xxxxx');
//gr.setValue('virtual',"False");
gr.setValue('virtual',"True"); //Virtual is the BOOLEAN field.
gr.update();
Thanks in advance,
Rahul
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Boolean values are true and false or "true" and "false". I would submit that the script does not work well with "False", rather it's not setting a value the same as "True" is not setting a value, so the result in both cases is an empty checkbox/false value since a boolean has to be either true or false.