Help with Code
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2024 06:03 AM
Hi Team,
we have a checklist on our change task form which is not getting displayed when we use Service Operations workspace.
As a workaround, we have created a client script to display a message everytime ctask form is loaded which has the hyper link for checklist. However when we click on this link it does not work. It works fine, when we press ctrl and then click on link. why is this happening. Please advise.
This is the code we have:
function onLoad() {
var ga = new GlideAjax('ClientAjaxUtils');
ga.addParam('sysparm_name', 'hasCList');
ga.addParam('sysparm_id', g_form.getUniqueValue());
ga.addParam('sysparm_table', 'change_task');
ga.getXMLAnswer(function(response) {
if (response == 'true') {
g_form.addInfoMessage('To see the Service Checklist, <a href="/nav_to.do?uri=change_task.do?sys_id=' + g_form.getUniqueValue() + '" target="_blank">click here</a>');
}
})
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2024 10:47 AM
Hi @dvelloriy Try below code
function onLoad() {
var ga = new GlideAjax('ClientAjaxUtils');
ga.addParam('sysparm_name', 'hasCList');
ga.addParam('sysparm_id', g_form.getUniqueValue());
ga.addParam('sysparm_table', 'change_task');
ga.getXMLAnswer(function(response) {
if (response == 'true') {
var message = 'To see the Service Checklist, <a href="javascript:void(0);" onclick="window.open(\'/nav_to.do?uri=change_task.do?sys_id=' + g_form.getUniqueValue() + '\', \'_blank\');">click here</a>';
g_form.addInfoMessage(message);
}
});
}