Catalog client script to remove drop down value if the values starts with SNOW

BanuMahalakshmi
Tera Contributor

Hi,

 

Need your help to remove(hide) the values starts with SNOW from the category drop down list into SP. The below script is working correctly  but i should remove dynamically instead of calling removeoption for each category.  If a new value(starts with SNOW) category is added in future, this code should remove it automatically from the particular record producer.

 

function onLoad() {
//Type appropriate comment here, and begin script below

g_form.removeOption('category', 'SNOW-Modules');
g_form.removeOption('category', 'SNOW-Compensation');

}

1 ACCEPTED SOLUTION

Phanindra N
Tera Guru

Instead of going with catalog client, can you try using reference qualifier to not show options starting with SNOW.

View solution in original post

13 REPLIES 13

Hello @BanuMahalakshmi 

 

Modify this line :-

 

 

	if(newValue.indexOf("SNOW")>-1){

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.

 

Regards,

Samaksh

Phanindra N
Tera Guru

Instead of going with catalog client, can you try using reference qualifier to not show options starting with SNOW.

Now that is starting to make sense.  What type is the category variable?

Pavankumar_1
Mega Patron

Hi @BanuMahalakshmi ,

I think category is a string field we don't have option to add reference qualifier to it.

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar