How to redirect to new tab/window from catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 07:39 AM
Hello all,
We have a catalog item with Multiple choice variable. If user clicks on one option, it should redirect user to a new request template. From onchange Client Script here is how I am trying to redirect-
else if(ag == 'SPIL Issue'){
var url = 'https://xxxxx.service-now.com/com.glideapp.servicecatalog_cat_item_view.do?v=1&&sysparm_id=28380818db6bcc902a862aea4b9619d1';
top.window.open(url);//,'','width=800,height=700');
}
top.window.open() indeed works but it opens the new tab in navpage view, not opening in portal view for end users. This might be happening becuase of hard coding of the url. Any idea how I can rectify this?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 07:53 AM
Hi Anurag,
you can try this
var url = '/sp?id=sc_cat_item&sys_id=28380818db6bcc902a862aea4b9619d1'
top.window.open(url);//,'','width=800,height=700');
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 08:16 AM
Hi Ankur,
I imagine, this would by default then take everyone to portal view, no? In our environment we have multiple portals depending on users company as well as nav page view for itil users. I wanted something that would take users to new view depending on their access in the environment. like if end user,go to end user view, if itil user, go to navpage view like this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 10:55 PM
Much appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 08:19 AM
Take a look at below:
https://community.servicenow.com/community?id=community_blog&sys_id=cbcda2e9dbd0dbc01dcaf3231f961949
Please mark my response as correct answer and helpful if it helped solved your question.
-Best Regards
Prateek kumar
Please mark my response as correct and helpful if it helped solved your question.
-Thanks