How to display email on incident form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 05:00 AM
Hello Eperts,
I have ui action and I want it to show modal with email body, subject and recepients.
function clickPreview() {
var ga = new GlideAjax('ajax');
ga.addParam("sysparm_name", "getEmail");
ga.addParam("sysparm_interaction_number", g_form.getValue('u_interaction_record'));
ga.getXML(getResponse);
function getResponse(response) {
var result = JSON.parse(response.responseXML.documentElement.getAttribute('answer'));
var msg = getMessage("Preview Email");
var dd = new GlideModal("preview_email");
alert(result.body);
dd.setTitle(msg);
dd.setWidth(800);
dd.setPreference('sysparm_id', result.sys_id);
dd.render();
}
}
Now I'm just pushing email's sys id and it displays ok but subject and recepients are missing. I'm also fetching email data from sys_email table. So i have access to all the info from email record. Setting up modals is new for me so I'm not sure how can I add data that I need easly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 05:26 AM
Hi @Dotychczas
OOTB we already have UI Action 'Preview Notification' which does almost same. You can try to replicate same here and see if that works.
UI Action link:
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 12:57 AM
Hi,
that didn't exactly help. Change of fields in this ui action is impossible due to no access to template that it uses. I found out that it can be changed in script include but this will be to big of a change and I'm afraid that I would mess other places where preview notification is being used. I need better explanation how it can be set up. I already fetch necessary data in ui action.
But thanks for your input anyway.
Kind Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 01:33 AM
You can't edit fields in provided ui action due to restricted access to template. You can workaround changing script include but I rather want to avoid that as it could impact other places that use it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2024 01:03 AM
Hi Mega Guru,
my requirement is same if you have got solution please share the code it helpful to every one.
Thanks,
Lakshman