hyperlink popup message containing a link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 11:31 PM - edited 02-01-2023 11:32 PM
Hello Experts, I need to hyperlink a popup message containing a link, please help! here is my script: function onChange(control, oldValue, newValue, isLoading) { if(g_form.getValue('application_available_in_teams_app_store') == 'no'){ alert('If app not available in Teams App store , Please raise JIRA front door request using this link - https://jira.secure/CreateIssueDetails!init.jspapid=33820&issuetype=39&summary=Workforce%20Front%20D...'); } }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 11:46 PM
Hello @Anubhav Srivas1 ,
Please use below script:
var urlString = '<p><a class="web" target="_blank" href="' + "Put your link here" + '">' + "Click Here" + '</a></p>';
g_form.alert('Your Incident is already escalated If you want to know more ,please click' + urlString);
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2023 11:16 PM
Hi, I tried your solution but it doesn't work and shows an error: there is a javascript error in your java console.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === 'yes') {
return;
}
var urlString = '<p><a class="web" target="_blank" href="' + "https://jira.service.anz/secure/CreateIssueDetails!init.jspapid=33820&issuetype=39&summary=Workforce..." + '">' + "Click Here" + '</a></p>';
g_form.alert('Your Incident is already escalated If you want to know more ,please click' + urlString);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 11:48 PM
Hi, your post does not make your issue\problem clear, what is the issue you are encountering and what are the details of your diagnostics\fault finding?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 11:52 PM
Hi @Anubhav Srivas1 ,
Can you try the same with a confirm? Instead of clicking the link, the OK button would navigate you to the desired location.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var url = 'https://www.google.com';
if (confirm('If app not available in Teams App store , Please raise JIRA front door request using this link - ' + url)) {
g_navigation.openPopup(url);
}
}