How to show hyperlink in field message
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2024 12:50 AM
Hi,
How to show hyperlink in field message, I tired with info message, but the requirement is field message.
Script include:
var IncidentHistoryBasedOnPSID = Class.create();
IncidentHistoryBasedOnPSID.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
getIncidents: function() {
var ps_id = this.getParameter('sysparm_newValue');
if (!ps_id) {
return '';
}
var incident = new GlideRecord('sn_si_incident');
incident.addQuery('u_ps_id', ps_id);
incident.query();
if (incident.hasNext()) {
return '<a href="/sn_si_incident_list.do?sysparm_query=u_ps_id=' + ps_id + '" target="_blank">Security Incident History: ' + ps_id + '</a>';
}
return '';
},
type: 'IncidentHistoryBasedOnPSID'
});
Client script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var a = new GlideAjax('sn_si.IncidentHistoryBasedOnPSID');
a.addParam('sysparm_name', 'getIncidents');
a.addParam('sysparm_newValue', newValue);
a.getXMLAnswer(function(response) {
g_form.clearMessages();
if (response) {
g_form.addInfoMessage('Related Security incidents:<br/>' + response);
} else {
g_form.addInfoMessage('No Related Security Incidents');
}
});
}
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2024 01:00 AM
Hi @Community Alums
You cant add links in the field message
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2024 01:00 AM
There are few alternatives, take a look at below links
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2024 01:45 AM - edited 09-20-2024 02:01 AM