UI Action to generate PDF

srujancherr
Tera Contributor

Hi,

I installed Document Template plugin and added my own HTML Template, I can preview from Document template template form, but I want same capability to preview and download the pdf from Incident table, can anyone help me on this.

6 REPLIES 6

Hi @Ankur Bawiskar ,

 

I couldn't get preview logic, but when i click on UI Action, using the html template i got apdf file attached to attachments,

here is the code,

var recordId = current.sys_id.toString();
var documentTemplateId = 'b473cc60838aaa10fba8c4e0deaad323';
var pdfName = current.number;
new sn_doc.GenerateDocumentAPI().generateDocumentForTask(recordId, documentTemplateId, pdfName);
action.setRedirectURL(current);
 
 
I need in word(Docx), can anyone help me on this

@srujancherr 

you cannot generate doc as ServiceNow doesn't have any API for that.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader