Enable Compose email button in HR agent configurable workspace list view
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 04:39 AM
Hi team,
I have a requirement to enable the "compose email" button in the list view of the HR agent configurable workspace. When the agent clicks the compose email button, it will open a new tab with an email draft, allowing the agent to fill it in and click the submit button. I have an existing action called compose email, but it only works for the old workspace. Could you please provide a solution for this?
script:
var LEGACY_EMAIL_CLIENT_NAME = 'sn-email-editor',
SEISMIC_EMAIL_CLIENT_NAME = 'sn-email-client-wrapper',
EMAIL = 'sys_email',
DRAFT = 'sys_email_draft',
tValue = DRAFT;
//get the list of renderers
var renderers = [];
if (ux_globals && ux_globals.presource['sn-workspace-content:snCustomRenderer']) {
renderers = ux_globals.presource['sn-workspace-content:snCustomRenderer'].data.GlideRecord_Query.sys_aw_renderer._results;
}
if (renderers.length > 0) {
// Filter out Email renderers
var renderMap = {};
renderers.filter(function(o) {
return o.table.value == EMAIL || o.table.value == DRAFT;
}).map(function(o) {
renderMap[o.table.value] = o.custom_renderer_tag.value;
});
//Figure out the final value
if (!renderMap.hasOwnProperty(DRAFT))
tValue = EMAIL;
else {
if (!renderMap.hasOwnProperty(EMAIL))
tValue = DRAFT;
else if (renderMap[EMAIL] == LEGACY_EMAIL_CLIENT_NAME)
tValue = EMAIL;
}
}
var dirtyFieldList = g_form.serialize(true).map(function(field) {
return {
field: field.name,
value: field.value
};
});
g_aw.openRecord(tValue, '-1', {parentTable: g_form.getTableName(), parentSysId: g_form.getSysId(), headerValue: getMessage("New Email"), dirtyFields: dirtyFieldList});
Labels:
- Labels:
-
Human Resources Service Delivery
10 REPLIES 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 05:35 AM
not very sure on this.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader