- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2016 03:09 PM
I need my selection list to be hyperlinks. I would like to link it to another form, is this possible?
Thanks in advance.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2016 06:19 PM
I am not sure about providing hyperlinks in choice list but there is an alternate workaround for this applying onChange script based on the choice values.
Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
if(newValue=="Your Choice Value 1")
window.location.href='problem.do';
if(newValue=="Your Choice Value 2")
window.location.href='incident.do';
.............................
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2016 06:19 PM
I am not sure about providing hyperlinks in choice list but there is an alternate workaround for this applying onChange script based on the choice values.
Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
if(newValue=="Your Choice Value 1")
window.location.href='problem.do';
if(newValue=="Your Choice Value 2")
window.location.href='incident.do';
.............................
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2016 05:04 AM
Hi Raju,
Thanks for responding. However its not working. I think I need to open it on a new tab. Can you provide the code for that?
This is what I have:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue=="Corporate FTP"){
alert('new value');
window.location.href="https://rrd.service-now.com/com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=b74b3622bd82...";
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2016 06:41 AM
What do you mean by not working? Can you provide the error?
I tried in my dev instance and it is working and redirecting to login page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2016 06:48 AM
No error message, it just not doing anything.
For now, I only have 2 options, if I click on Corporate FTP, it doesn't launch the link. This happens all the time for my other links within ServiceNow, I had to open them in a new tab by using <a target="_blank" href="URL". But I am not sure how to do that using your script.
Thanks!