Need to hide choice list on the field which is under section

harinya
Tera Contributor

function onload(){

var value=g_form.getValue('connect');

if(value=='6')//6 is the backend value of my connect choice

{

g_form.removeOption('result', '4');

}

else{

g_form.addOption('result', '4', 'confirmed');

}
but this code is not working can some one help on this , 
result filed is in form section as like below image

harinya_0-1742399188559.png

 


Thanks in advance

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

@harinya 

Things to check

1) are you comparing the correct choice value for connect?

2) is the connect field on form? if not then you won't get the value of that field

3) as per screenshot the field is Resolution code whose column name is close_code. are you setting correct choice to correct field?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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