glide modal display message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 09:54 PM
Hi ,
I am unable to put spaces between see and hyperlink.
please refer the below code.
var kbSysId = "e97ee81eff6002009b20ffffffffffe0";
var kbNum = "KB1000011";
var hyperlink = "<a href='/kb_knowledge.do?sys_id=" + kbSysId + "' target='_blank'> " + kbNum + "</a>";
var message = "Incidents with priority1 please ,see" + hyperlink+ ".";
var dialog = new GlideModal("alert_modal",true);
dialog.setTitle("alert");
dialog.setPreference("title", message);
//dialog.renderWithContent(message);
dialog.render();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 10:36 PM
Please update the code as:
var hyperlink = " <a href='/kb_knowledge.do?sys_id=" + kbSysId + "' target='_blank'> " + kbNum + "</a>";
Please let me know if it works, though it worked for me in my PDI!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 10:44 PM
can u please use the below ui page in as alert_modal in ur instance and check once.
I tried that way u have shown but it did not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 11:04 PM
Can you share the scripts, instead of screenshot let me configure in my PDI and let you know!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 11:10 PM
UI page script alert_modal
HTML
<g:ui_form onsubmit="return invokeConfirmCallBack('ok');">
<table width="100%">
<tr><td/><td/></tr>
<tr>
<g:evaluate jelly="true">
var title = (jelly.RP.getWindowProperties().get('title') || '') + '';
title = new GlideStringUtil().unEscapeHTML(title);
</g:evaluate>
<td ><g:no_escape>${title}</g:no_escape></td>
</tr>
<tr><td/><td/></tr>
<tr>
<td colspan="2" align="right">
<g:dialog_button_ok
ok="invokePromptCallBack('ok');"
ok_type="\tbutton" />
</td>
</tr>
</table>
</g:ui_form>
client script
function invokePromptCallBack(type) {
var gdw = GlideDialogWindow.get();
var f = gdw.getPreference('onPromptComplete');
if (typeof(f) == 'function') {
try {
f.call(gdw, gdw.getPreference('oldValue'));
} catch(e) {
}
}
gdw.destroy();
return false;
}
On change client script on incident form.
var priority = g_form.getValue('priority');
if (priority == '1') {
var kbSysId = "e97ee81eff6002009b20ffffffffffe0";
var kbNum = "KB1000011";
var hyperlink = "<a href='/kb_knowledge.do?sys_id=" + kbSysId + "' target='_blank'> " + kbNum + "</a>";
var message = " please confirm the priority , see"+ hyperlink+ ".";
var dialog = new GlideModal("alert_modal",true);/use UI page here
dialog.setTitle("alert");
dialog.setPreference("title", message);
//dialog.renderWithContent(message);
dialog.render();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 12:14 AM
Update your code as just in onchange client script:
var hyperlink = " <a href='/kb_knowledge.do?sys_id=" + kbSysId + "' target='_blank'> " + kbNum + "</a>";
Please mark it resolve and helpful if it works!