- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 08:47 PM
Hi Team please help me!!!
I need to redirect this URL https://dev184220.service-now.com/com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=3a2563... to portal URL (https://dev184220.service-now.com/sp?id=sc_cat_item&sys_id=3a25637b47701100ba13a5554ee490a0)
native UI to Portal URL. Please suggest me.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 11:05 PM
As asked by you below is the code that the functionality will not affect admins
var redirectionOccurred = false;
function onLoad() {
redirectionOccurred=false;
if (!g_user.hasRole('admin') && !redirectionOccurred) {
alert("You will be redirected");
var url = 'https://dev243190.service-now.com/com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=f5d8d3f6e8b721004ece55c82c089cc6';
if (url) {
// Redirect to the new URL
top.window.location = "https://dev243190.service-now.com/sp?id=sc_cat_item&sys_id=f5d8d3f6e8b721004ece55c82c089cc6&referrer=recent_items";
redirectionOccurred = true;
}
}
}
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 09:13 PM
You can try the below Script
(function executeRule(current, previous /*null when async*/) {
if (current.uri == 'com.glideapp.servicecatalog_cat_item_view.do') {
current.setRedirectURL('https://dev184220.service-now.com/sp?id=sc_cat_item&sys_id=3a25637b47701100ba13a5554ee490a0');
}
})(current, previous);
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 09:18 PM
Thanks for reply. Which table I need to use and what type of BR let me now please.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 09:21 PM
Hi
you can use sc_cat_item table
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 09:26 PM
It is not working @SAI VENKATESH