Order guide search pointing to catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 03:29 AM
Hi Team ,
I have an order guide that is pointing to catalog item url
I have gone through few community links , but unable to fix the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 03:39 AM - edited 06-11-2024 03:40 AM
Hi @soumyadaggula ,
Not sure if you have already reviewed this post.
Pasting the script for reference :
Create on the order guide as an onLoad script
function onLoad() {
//Type appropriate comment here, and begin script below
var qury = getParameterValue("id");
var sysId =getParameterValue("sys_id");
//alert('ji-- '+qury);
if(qury == "sc_cat_item"){
top.window.location = "/sp?id=sc_cat_item_guide&table=sc_cat_item&sys_id="+sysId
}
function getParameterValue(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(top.location);
if (results == null) {
return "";
} else {
return unescape(results[1]);
}
}
}
Snippet referred from : https://www.servicenow.com/community/developer-forum/portal-search-experience-order-guide-sc-cat-ite...
This one seemed very close to what you asked for.
Please mark helpful and accept as solution if this answered your query.
Thanks,
Mahathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 03:46 AM
@Mahathi
Hello Mahathi ,
yes , I tried the above onload script , but somehow when I use this script , its changing the portal view/ background color .
Is there any other possible way to fix this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 03:58 AM
Hi @soumyadaggula ,
I found a KB Article but i think that is also redirecting to same script i had mentioned.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1213471
You can see if option 1 of the workaround works.
Please mark helpful and accept as solution if this answered your query.
Thanks,
Mahathi