how to restrict catalog client script to run if item is order guide in servicenow

vivekreddym
Tera Contributor

Hi Team, 
I am using the same variable set in both "Order guide" and "Catalog item".
But client script should run only if the item Catalog item and not the Order Guide.

Can any one help on this(It should work in portal and Native Ui)

1 REPLY 1

Anand Kumar P
Tera Patron

Hi @vivekreddym ,

 

Use below script in your onload client script :

 

function onLoad() {
var isOrderGuide = g_service_catalog.isOrderGuide();
if(isOrderGuide) {
//part of an order guide you can hide the variables accordingly.
} else {
//not a part of an order guide.
}
}

 

If my response helped, please mark it as the accepted solution and give a thumbs up👍.
Thanks,
Anand