- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 06:25 AM
Hi all,
I have some old items that I've now included in an order guide instead of those separate items.
However, users have saved the url:s to the specific items so when they use the url:s they will not end up in the order guide. Is there a way I can force the users to go to the order guide instead of using direct links to the items? I've already checked the "No search" box but that doesn't prevent the direct links to the forms but at least they cannot search for the items.
Thank you in advance,
Ulrika
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 06:41 AM
Hi Ulrika,
An onLoad Catalog Client script on the Catalog item that you do not wish users to directly access will help.
In there you can redirect the user, using the following code:
Replace google.com with your own URL.
function onLoad() {
top.window.location ='http://google.com';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 07:07 AM
You could also create a variable set that would contain the onLoad Catalog Client Script and add that to the relevant Catalog Items.
But you need one more thing for this to work properly - a test whether the current context is a stand-alone Catalog Item, or an Order Guide:
if (g_service_catalog && !g_service_catalog.isOrderGuide()) {
// redirect code;
}
If you don't do the check, the onLoad Catalog Client Script will execute on the Order Guide too and will redirect on the Order Guide too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 03:18 AM
You're welcome! 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 04:30 AM
I have the same issue, and when I try the top.window.location solution it also redirects back to the order guide when the catalog item is included and the next button clicked on the order guide. So it basically creates a loop. How can I stop that from happening?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 04:45 AM
I figured it out. Here's what I did:
function onLoad() {
var loc = top.window.location;
var index = loc.toString().indexOf("sp?id=sc_cat_item&sys_id=61b415bb1b1de110fbbbeaccac4bcb52");
if (index >= 0) {
top.window.location = "sp?id=sc_cat_item_guide&sys_id=dd9455db1b123590fbbbeaccac4bcbed&sysparm_category=e3f8de0e1b1d3810595ea7dbe54";
}
}