How can I set the value of a boolean field in a client script?

ralphalberti
Kilo Expert

I see there is a GlideForm method of getBooleanValue(String fieldName) but no method to set the value.

Is there something like setValue(String fieldName, String value) for booleans?

--Ralph

 

1 ACCEPTED SOLUTION

Hemant Goldar
Mega Sage
Mega Sage

Hi Ralph,

 

In client Script, you can use

  g_form.setValue('field_name',true);// set boolean field value true 

Hope this helps!

Please mark the reply as Helpful/Correct, if applicable.

Regards,
Hemant

View solution in original post

2 REPLIES 2

Hemant Goldar
Mega Sage
Mega Sage

Hi Ralph,

 

In client Script, you can use

  g_form.setValue('field_name',true);// set boolean field value true 

Hope this helps!

Please mark the reply as Helpful/Correct, if applicable.

Regards,
Hemant

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Ralph,

To set the boolean value you should use g_form.setValue('fieldname',true); //true or false  as you mentioned.

-Pradeep Sharma