- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 03:20 PM
Hi all,
I am currently working on a catalog client script to re-direct user to a specific page after they click on a catalog item. I was able to do it by using an Onload catalog client script but after it re-directs gets into an infinity loops.
function onLoad() {
//Type appropriate comment here, and begin script below
top.window.location = "sp?id=sc_cat_item_new_page&sys_id=109cdff8c6112276003b17991a09ad65";
}
How I can prevent the infinity loop?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 10:41 AM - edited 01-19-2024 10:42 AM
Here is how I got it worked.
1. Create a new service portal page, added my custom widget
2. Duplicate the catalog item
3. Hide the original catalog item from the portal
4. On the new catalog item added the catalog client script pointing to the original catalog item on the new page.
Tested out and working fine, when the user click on the new catalog item it re-direct very quick to the correct one. User will see like a flash less than a second the new one but is very fast. I didn't added any variables to the new one as it always will re-direct the user to the correct catalog item.
An additional thing that I had to do on the new page was to add new Dynamic page title variable to get the catalog item name on the title tab.
Thanks @SanjivMeher and @Jim Coyne for all your suggestions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 10:28 AM
Yes, but I'm getting an error message:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 03:46 PM
One more try
function onLoad() {
//Type appropriate comment here, and begin script below
var oldloc = top.window.location+'';
if (oldloc.indexOf('sp?id=sc_cat_item_new_page')==-1)
top.window.location = "sp?id=sc_cat_item_new_page&sys_id=109cdff8c6112276003b17991a09ad65";
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 10:41 AM - edited 01-19-2024 10:42 AM
Here is how I got it worked.
1. Create a new service portal page, added my custom widget
2. Duplicate the catalog item
3. Hide the original catalog item from the portal
4. On the new catalog item added the catalog client script pointing to the original catalog item on the new page.
Tested out and working fine, when the user click on the new catalog item it re-direct very quick to the correct one. User will see like a flash less than a second the new one but is very fast. I didn't added any variables to the new one as it always will re-direct the user to the correct catalog item.
An additional thing that I had to do on the new page was to add new Dynamic page title variable to get the catalog item name on the title tab.
Thanks @SanjivMeher and @Jim Coyne for all your suggestions.