HR Task: Document Template with "Preview Document" UI Action

psypniew
Mega Guru

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.

1 REPLY 1

Shruti
Mega Sage
Mega Sage

Hi,

Here is the workaround to create a document template field and Preview document UI action on HR task table

UI action

Shruti_0-1754567041186.pngShruti_1-1754567060836.png

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

Shruti_2-1754567347350.png

Open a HR task and update document template and assigned_to field. Only assigned to users will be able to preview document

Shruti_3-1754567444036.png