Open the catalog item in a new tab when "No' is selected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2024 04:19 PM
Hi All,
I need help with a particular catalog client script. It works correctly, but we would prefer to open the item in a new tab rather than the current one.
function onChange(control, oldValue, newValue, isLoading) {
if(g_form.getValue('confirm') == "No")
// confirm is a yes/no type variable
{
top.window.location.href = ("https://dev788.service-now.com/sp?id=sc_cat_item&sys_id=c16222491b532510f761eb95604bc745");
// window.open( "https://dev788.service-now.com/sp?id=sc_cat_item&sys_id=c16222491b532510f761eb95604bc745", '_blank');
}
}
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2024 06:28 PM
Hi @MR1 ,
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue=='No'){
alert("You are being redirected to the SailPoint site.");
window.open( 'http://www.google.com/', '_blank'); // <- This is what makes it open in a new window.
}
}
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2024 05:44 AM - edited ‎04-16-2024 11:15 AM
Unfortunately, the above script didn't work.
I got the alert pop-up but it didn't open the link in the new tab
Thanks