Document Template

Vedavalli
Tera Contributor

Hi

I've created a document template on incident table.
var recordId = 'a9a16740c61122760004fe9095b7ddca';(problem sys_id)
var documentTemplateId = '50e6c385db175e10727ee7dcd39619f2';
var pdfName = 'INC_Template.pdf';
new sn_doc.GenerateDocumentAPI().generateDocumentForTask(recordId, documentTemplateId, pdfName);
with this script I'm trying to pass problem record sys_id which the incident attached to generate document for the problem record . but it's showing me the 

sn_doc (GenerateDocumentAPISNC): User do not access to the record

 how to generate document for problem (I'm using incident table to populate incident fields data)
thanks in advance

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@Vedavalli 

I believe I answered your earlier question about UI action.

UI Action is not visible in workspace 

Would you mind closing your earlier questions by marking appropriate response as correct?

Members have invested their time and efforts in helping you.

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

Hi @Ankur Bawiskar 
I followed the approach you mentioned still not showing

@Vedavalli 

I shared 2 working solutions, please respond to that question which one is not working.

It worked fine for me.

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

Visibility I've checked and creating new button also both didn't worked. It's custom workspace