Redirecting Users from a Catalog Item to Another URL in Service Portal

RachidB
Tera Contributor

Hello Community,

I have a requirement where, if a user tries to access a specific catalog item, they should be redirected to another URL.

I created a client script for this "

function onLoad() {
    window.location.href("www.youtube.com");
}

", and it works fine in the classic view. However, it doesn't work in the Service Portal.

Has anyone implemented a similar solution or knows how to achieve this in the Service Portal? I would really appreciate any guidance or suggestions.

Thank you in advance!

2 ACCEPTED SOLUTIONS

Robbie
Kilo Patron
Kilo Patron

Hi @RachidB,

 

Have you checked out or leveraged the 'Page Route Maps'? This is exactly what they're for and pretty self explanatory as to how to set up...

Simply type 'Page Route Maps' into the Navigation menu and click on the link - example shown below.

 

To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.





Thanks, Robbie

 

Screenshot 2024-11-28 at 11.05.39.png

 

View solution in original post

Sebastian L
Mega Sage

I don't like this approach. I think you instead should use a content item to redirect the user to where they should find the item.. So when they click on it they get redirected correctly... 

 

If you reeeally want this solution you can do it like this: 

function onLoad() {
location.href = '?id=ec_dashboard'; //Change to your destination
}

 

Link to content item documentation: Define a content item 


Best regards,
Sebastian Laursen

View solution in original post

5 REPLIES 5

Robbie
Kilo Patron
Kilo Patron

Hi @RachidB,

 

Have you checked out or leveraged the 'Page Route Maps'? This is exactly what they're for and pretty self explanatory as to how to set up...

Simply type 'Page Route Maps' into the Navigation menu and click on the link - example shown below.

 

To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.





Thanks, Robbie

 

Screenshot 2024-11-28 at 11.05.39.png

 

If it was a generic re-direct then yes, this is the right (and only!) approach, but in this case it is not an option I'm afraid. 


Best regards,
Sebastian Laursen

RachidB
Tera Contributor

Thank you for your reply, I truly appreciate your assistance.

Sebastian L
Mega Sage

I don't like this approach. I think you instead should use a content item to redirect the user to where they should find the item.. So when they click on it they get redirected correctly... 

 

If you reeeally want this solution you can do it like this: 

function onLoad() {
location.href = '?id=ec_dashboard'; //Change to your destination
}

 

Link to content item documentation: Define a content item 


Best regards,
Sebastian Laursen