how to restrict catalog client script to run if item is order guide in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @Anand Kumar P ,
i tried the steps before.it is not working
If any other thoughts. Let me know
