Need to restrict choice fields in close code field,when particular type is selected in onchange task

Abhilasha G T
Tera Contributor

Hi Team,

 

Need to restrict choice fields in close code field, when particular type (CI Outcome) is selected in on change_task

form,

AbhilashaGT_2-1736509172716.png

 

i have written on change client script, its not working as expected, 

On change, Field Type close code, selected

AbhilashaGT_0-1736508668250.png

all the choice fields is showing ,

AbhilashaGT_1-1736509118942.png

 

 

how to achieve this.

 

Regards,

Abhilasha G T

3 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@Abhilasha G T 

is it going inside that IF?

are you comparing the correct value?

what debugging have you done so far and what's your analysis and findings?

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

View solution in original post

Sandeep Rajput
Tera Patron
Tera Patron

@Abhilasha G T Your onChange client script triggers on which field? 

View solution in original post

@Abhilasha G T You need to write an else condition and remove the additional choices. You can use g_form.removeOption method to remove the choices.

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Abhilasha G T 

is it going inside that IF?

are you comparing the correct value?

what debugging have you done so far and what's your analysis and findings?

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Abhilasha G T 

Please mark your earlier questions as answered by marking appropriate response as correct to close the thread as members have invested their time and efforts responding to them.

This helps future members.

Date and time configuration in change form 

i need to lookup only active users in a particular view in incident record. 

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

Sandeep Rajput
Tera Patron
Tera Patron

@Abhilasha G T Your onChange client script triggers on which field? 

Hi Sandeep, 

Thank you i didnt notice the Field Type.

 field name is Type = CI Outcome,

now its showing correct choices , as i expect like below,

AbhilashaGT_0-1736517225639.png

 

 

 

but if we select the other Type= Implementation,

 

all choices is showing , it should not happen, what ever the the choices i created newly its should not apper in the other Type like in implementation, Review

how to do that