How to hide question choices on a service catalog item

Milan Hrdlicka
Kilo Contributor

I have a service catalog item containing 4 question choices.

I need 2 of these question choices hidden based on current user's logged in role.

The crucial thing is I am unable to check out how to hide thse fields even without the dependancy on a user's role.

I tried this:

g_form.removeOption('value','cym3');
g_form.removeOption('value','cym6');

'value' is question choice's value. I tried this in Catalog client script however it does not work.

I use Madrid instance.

Can anyone please help?

Thanks a lot!

Milan

 

 

14 REPLIES 14

Milan Hrdlicka
Kilo Contributor

I am testing it within servicenow instance, not in portal, I checked the values and not sure why it doe not work.

Thanks a anyway.

Milan

can you put alert in your catalog client script and see if it's giving you an alert or not?

alert('hey you !');

 

if you are doing it on PDI then i can try to look into that 

 

Milan Hrdlicka
Kilo Contributor

Alert in Catalog Client Script works fine...not sure what PDI is 🙂

Milan

are you doing it on personal instance? if yes i can try to troubleshoot the issue 

Milan Hrdlicka
Kilo Contributor

Yes personal instance - https://dev77493.service-now.com/?_ga=2.103653888.1280936268.1556343401-674383640.1544081895

username: admin

password: Nilan+Aus+2004

Service Catalog Item: Brother Network-Ready Printer Toner

Thanks a lot. Milan