HR Task: Document Template with "Preview Document" UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 02:46 AM
Hello Community,
I need to add an HTML Document Template on HR Task, and have the "Preview Document" UI Action on the HR Task.
By default, document_template column is on the HR Case Table but not in the HR Task Table.
How can I achieve this ?
Thanks and Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 04:52 AM
Hi,
Here is the workaround to create a document template field and Preview document UI action on HR task table
UI action
function previewDocTemplateDocument() {
var sysId = g_form.getUniqueValue();
var dialogClassHtml = GlideModal ? GlideModal : GlideDialogWindow;
var dialogHtml = new dialogClassHtml('sn_hr_core_preview_html_document_dialog');
dialogHtml.setTitle(getMessage('Preview Document'));
dialogHtml.setPreference('sysparm_caseTable', g_form.getTableName());
dialogHtml.setPreference('sysparm_caseId', sysId);
dialogHtml.render();
dialogHtml.setWidth(800);
}
Document template field XML - Import attached XML
Create a document template on HR task table
Open a HR task and update document template and assigned_to field. Only assigned to users will be able to preview document