The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Removing Standard Changes category from portal.

Yash31
Tera Contributor

Hi,

I have a requirement in my project where, the "Standard Changes" Category needs to be removed or hidden from "SC_categories" widget in portal. This category should be available in native UI but not in Portal. So making it "Actvie=false" is not an option.

As of Now I have tried Setting the "Hide on Portal" option available in Change Templates available under this category.

The templates/items are not visible on the portal now, however the category is still visible on portal.

Can anyone help on this?

1 ACCEPTED SOLUTION

Monika2
Giga Guru

Hello Yash,

As per my knowledge ootb there is no way to achieve the same. You can create a custom boolean field on sc_category table as "visibility_on_portal" and keep it true for "Standard Change" category.

 

Now you need to clone the existing SC Categories widget and add below code in server script

var sc = new GlideRecord('sc_category');

sc.addQuery('sys_class_name', 'sc_category');

sc.addQuery('visibility_on_portal', 'true'); 

sc.addActiveQuery();

 

Replace this cloned widget with the existing "SC Categories" widget.

Hope this helps.

 

Regards,

Monika

View solution in original post

3 REPLIES 3

Monika2
Giga Guru

Hello Yash,

As per my knowledge ootb there is no way to achieve the same. You can create a custom boolean field on sc_category table as "visibility_on_portal" and keep it true for "Standard Change" category.

 

Now you need to clone the existing SC Categories widget and add below code in server script

var sc = new GlideRecord('sc_category');

sc.addQuery('sys_class_name', 'sc_category');

sc.addQuery('visibility_on_portal', 'true'); 

sc.addActiveQuery();

 

Replace this cloned widget with the existing "SC Categories" widget.

Hope this helps.

 

Regards,

Monika

If it is just for one category and you don't want to hide any other categories in future you can simply hardcode with below code in server script of SC Categories widget.

categoriesGr.addEncodedQuery(title!=Standard Changes);

 

Regards,

Monika

warren_chan
ServiceNow Employee
ServiceNow Employee

Hi Yash,

I don't believe there is a way to accomplish this OOB and agree with Monika that cloning/modifying the widget is the only suitable workaround. 

I reported this as an issue with HI support and they have raised PRB1418683 for it.

Thanks,

Warren