g_form.setValue('box',true); doesn't work on service portal

sonita
Giga Guru

This code is perfectly fine on Try it , but doesn't work on service portal

variable 'box' is a checkbox 

 

g_form.setValue('box',true);   doesn't work on service portal 

 

I even selected UI type to be 'All' ; but still doesn't work on portal.

1 ACCEPTED SOLUTION

Rakhesh
Kilo Guru

Hi Sonita,

 

I'm getting the result. I'm using the UI policy. follow the below screenshots it works.

 

find_real_file.png

use runscripts in ui policy.

 

 

find_real_file.png

View solution in original post

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Sonita,

What error you are getting in browser console?

Can you add that here or the screenshot?

Seems to be issue with instance?

What version you are using?

https://community.servicenow.com/community?id=community_question&sys_id=0d19dfeddb9d13c8fc5b7a9e0f9619a0

As per above link it is an issue in Kingston patch2 

Patch 4 solves this:

https://docs.servicenow.com/bundle/kingston-release-notes/page/release-notes/quality/kingston-patch-4.html

Regards

Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Rakhesh
Kilo Guru

which client script are you trying?

if you want a checkbox true when page loading no need to write a onload client script. Set Default value to true in variable level.

Rakhesh
Kilo Guru

Hi Sonita,

 

I'm getting the result. I'm using the UI policy. follow the below screenshots it works.

 

find_real_file.png

use runscripts in ui policy.

 

 

find_real_file.png

Actually i'm working on an onchange client script ; works perfectly in itil view , but doesn't work in portal view